that’s peculiar, does your Cloudflare have any logs about the attempt, judging by this, maybe cURL on your server is unable to validate the certificate name.
This may be an SSL issue with your server.
Not all sites using FlexSSL have this error. The ones I am finding that do not are on my own VPS systems running EasyEngine in which EE registers certs using Let’s Encrypt which means they are not self-signed.
A 524 error states that Cloudflare was able to make a TCP connection to the origin, but the origin did not reply with a HTTP response before the connection timed out. This means that Cloudflare is able to make a network connection to the origin server, but the origin server took too long to respond to the request.