5xx errors are caused by the website host response when Cloudflare tries to connect.
Cloudflare’s IP addresses are here:
Here’s some more information on 524 errors: