I had the same problem and have been through an odyssey of several months for this reason.
I ended my two attempts with self-operated instances of Nextcloud and am now with a provider for Managed Nextcloud.
There I bought two productive instances and got a third test instance from the provider for free, so that I can use it as a test environment exactly and only for this problem. So far I have been able to reproduce the problem again and again. I also provided two accounts of this test instance to the Joplin developers so that they could reproduce the problem themselves. As moontan described, the problem only occurs between NextCloud and Joplin Android apps in which multiple Joplin instances are configured. I do not have this problem with Joplin apps on Windows or Linux. The Joplin Android app with multiple profiles does not have this problem with other cloud solutions besides Nextcloud either.
I am not a developer and never will be. My amateur understanding of this problem is that it is a problem with the correct assignment of the credentials of the different profile users at the WebDAV interface. From the point of view of the Joplin Android app, it seems that when switching from the first to the second profile, it passes the correct credentials of the second user to the Nextcloud server, but the server denies access to the corresponding subdirectories or claims that they do not exist. One of the two sides (WebDAV stack on Android or WebDAV stack on the Nextcloud side) does not process the change of credentials correctly.
We are therefore looking for Nextcloud experts to try to extract the relevant logs from the Nextcloud side - if necessary by activating verbose mode.