I have another solution for anyone having this issue in 2024/2025. This what worked for me, at first it wasn't so obvious, but it worked.
Open the Notes app on your phone > Theirs Two folders One at the top is named "iCloud" thats where you want all your notes written or forwarded from your "On my phone" if you want them sync with all your devices.
Then you have the next folder "On my iPhone" which is exactly what it says, all notes written on there are saved on your phone only.
Your notes on your Mac (desktop/Laptop) device can be configured as you wish by opening the Notes app and clicking > Note at the top of menu then clicking > Settings.
