Interesting. Based off this information and the fact you’re able to connect from the original location, it leads me to believe that the failure to connect might be due to a network setting/configuration from the “wifi there” location you’ve noted.
I’ve seen a few posts in the pasts regarding connectivity failures from cafe wifi’s and such in which the wifi in these particular spots did not allow outbound traffic to/from port 27017 (as one example).
The following blog post How to Deploy MongoDB on Heroku | MongoDB may be of use to you. It does have details regarding Configuring Heroku IP addresses in MongoDB Atlas as well.
Regards,
Jason