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.