MongoDB Atlas can't be reached even if all IPs are whitelisted

I am unable to connect to my Atlas instace from the nodejs app I wrote but only from the app hosting website. When testing locally it works fine. I tried whitelisting all IPs plus the one given by hosting platform support but no luck. When trying another MongoDB hosting platform it worked fine. What seems to be the problem?