I think you have an issue with your replica set configuration.

I suspect that your replica set configuration uses host names rather than the IP addresses you use to connect, and that some of those are not resolved correctly by your DNS.

Using a command line terminal share the output of the following.

ping masternode

Then connect with mongosh to a single node, 192.168.20.1:27017 for example and share the output of the command:

rs.status()