What was the error code shown to you?
Related to the 524 error, may I ask which of the troubleshooting steps from the below article have you tried already?
Before moving to Cloudflare, was your Website working over HTTPS connection?
Does it work normally over HTTPS when Cloudflare is Pause?
May I ask what SSL option have you got selected under the SSL/TLS tab at Cloudflare dashboard for your domain ( Flexible, Full, Full Strict … )?
Any security plugin running at your WordPress instance?
Are you using Cloudflare APO for WordPress maybe?
Or some firewall is installed at your origin host/serer?