Error 521 web server is down, but it's not

We are facing some issues when trying to reach these domains:

I have one domain and a subdomain that was working just fine until Friday, for sure.

Now, I am getting error 521 when trying to reach the domains. No changes were made in the web server, I’ve double-checked the Cloudflare IPs and all of them are whitelisted on our server.

It’s curious that accessing via the server’s public IP, the website loads well, with no errors.

Another thing that I’ve noticed is that the request via the domain is also reaching the webserver, but somehow can’t establish a connection.

It’s a nodejs app running on pm2. Surely the application is running properly without errors since I can access via public IP

Any idea what could it be?