I suspect there's some bug in how Joplin handles cookies on Android. I am seeing issues even without 2 profiles like this:
- start with a clean state
- enter nextcloud details and press "Check Synchronization Configuration"
- now without leaving the screen change the details to another user on the same server
- check configuration succeeds but when you try to actually sync NC returns "permission denied"
I think some cookie specific to a particular nextcloud account gets saved on step 2 and then incorrectly used for all subsequent steps for a different account.