524 error and Connection Lost Error

That sure sounds like a server problem. Cloudflare can’t fix that. It just reports the 524 because your server isn’t able to process the request in a short enough amount of time.

As for a quick fix for the 524, my approach is to add the server’s actual IP address to my local hosts file so I bypass Cloudflare and its timeout limitations.