524 Error not related to host

Regarding 524 error, here are some suggestions and tips to check:

https://support.cloudflare.com/hc/en-us/articles/115003011431-Troubleshooting-Cloudflare-5XX-errors#524error

Are those sub-domains both being :orange: cloud at Cloudflare Dashboard?

Moreover, do they both have an SSL certificate installed?

Maybe you would need to have :grey: cloud for those DNS records (I assume you are using a CNAME record type?)