It’s hard to know what happened, but you may have to do a full reset in order to put your profile in a clean state. See How to fix synchronisation issues and start over
This will mean wiping your Joplin data from all your devices and Dropbox though, so before doing so, make sure you have a backup of all data you wish to retain in a decrypted state. You may need to make a jex backup on your Mac and on your phone if the decrypted data is split across devices. Then you will have to manually combine them if that is required