Uploading with stk500v2 not working with Atmega328p and macos Sonoma

I have a project with atmega328p on 16MHz.
Trying to upload the code on Sonoma did not work with upload_flags


as in my previous post:
Uploading with stk55v2 not working with attiny84 in dec 2023
Error: Verifying error

Changing the path for C in the upload_flags to


as mentioned by maxgerhardt did the upload.
New upload_flags:

upload_flags =

Perhaps this could be helpful for other users. Or is there another workarround?