Check your username and password. Type it manually (without copying and pasting it) and try again.
Check the WebDAV URL - to get the correct URL, go to Nextcloud and, in the left sidebar, click on “Settings” and copy the WebDAV URL from there. Do not forget to add the folder you’ve created to that URL . For example, if the base the WebDAV URL is “https://example.com/nextcloud/remote.php/webdav/” and you want the notes to be synced in the “Joplin” directory, you need to give the URL “https://example.com/nextcloud/remote.php/webdav/Joplin” and you need to create the “Joplin” directory yourself .
On the desktop application or mobile application , go to the config screen and select Nextcloud as the synchronisation target. Then input the WebDAV URL (to get it, click on Settings in the bottom left corner of the page, in Nextcloud), this is normally https://example.com/nextcloud/remote.php/webdav/Joplin ( make sure to create the “Joplin” directory in Nextcloud ), and set the username and password. If it does not work, please see this explanation for more details.
This was very helpful, I'm running my own NextCloud and using an older version of Joplin in Windows 7 and I created a top level folder in my NextCloud instance and then I queried Nextcloud as to what the correct WebDav URL is and I used that to get synchronization for Joplin to work. I did have to add "/Joplin" to the URL that Nextcloud gave which looks to be the URL to my general account and was not folder specific, e.g. ".../Joplin". I appended the Joplin folder and verified in Nextcloud that all the files were being sequestered under the Joplin folder. The nuances of paths @tessus highlights was extremely helpful. Thank you!