To reproduce:
1. Run up a mongo server like so:
docker run --rm -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=mongoroot -e MONGO_INITDB_ROOT_PASSWORD=password mongo:4.2.6
2. In compass:
New connection -> Fill in fields manually -> Authentication: SCRAM-SHA-256 -> Username: mongoroot, Password: password -> Connect
Compass should connect ok.
3. Favourite-> Enter a name -> Save
4. Connect -> disconnect
5. [The new favourite should still be selected] Paste connection string -> Connect
At this point you should see "Authentication Failed" Error.
In the server logs I also see:
2020-09-30T16:35:28.147+0000 I ACCESS [conn104] SASL SCRAM-SHA-256 authentication failed for undefined on admin from client 172.17.0.1:35858 ; UserNotFound: Could not find user "undefined" for db "admin"