Check the logs on your server to see what happens when you try to connect to it while the DNS record is proxied. What’s your SSL Mode set to in the Cloudflare dashboard? Assuming you have a valid SSL certificate on your server (which you hopefully do) make sure you’re set to Full(Strict), as Flexible can cause a redirect loop, easily visible in the server logs.
Thanks for your comment, There are no logs Cloudflare just does not like port 443. If I use port 8443 everything works without issues, change back to port 443 and boom error 521, it does not even attempt to connect to my web server just gives the error straight away.