Ok, I realise it’s been a while but, for the sake of other who might hit this problem (or one like it), us Nextcloud users are generally using it because we’re security-conscious and like to keep our data private.
If you’re like me, you might have enabled 2FA which means if you enter your ‘usual’ password in your config file, you can’t then enter your second authentication method.
If this is the case, you’ll need to create a ‘one-time’ password in Nextcloud and use this instead of your ‘normal’ password. Get one by going to Nextcloud settings, Security and scroll to bottom. Hit ‘Create new app password’ and copy to the URL in the config.