The error indicates a possible SRV lookup failure.
Could you try using the connection string from the connection modal that specifies all 3 hostnames instead of the SRV record? To get this, please head to the Atlas UI within the Clusters section and follow the below steps:
Click Connect on the cluster you wish to connect to
Select Connect your application
Choose Node.JS for the Driver option
Choose the *Version 2.2.12 or later for the version option
Copy and use the connection string which should begin with the following format: mongodb://<username>:<password>....
Replace the original connection string you used with the version 2.2.12 or later node.js connection string copied from the above steps and then restart your application.
If it returns a different error, please send that error here.
I love you !! Seriously !! You saved me and made me the whole week Thank you very much and even though I tried your solution before and it did not work properly maybe
because the function of creating a collection had something in it that disrupted the query process