May I ask what have you tried yet due to 522 error?
Does anything changes if you Pause Cloudflare for your domain?
Or temporary switch the cloud DNS records to cloud?
There were some cases like, maybe you have got Firewall on the Router or your ISP provider does not support (block) traffic on some port you are trying to work with?
Due to 522 errors, here are usefull tips to troubleshoot:
May I also ask if you have got an SSL certificate for your domain and your sub-domain(s) installed at your host/origin server?
Was it working over HTTPS before moving to Cloudflare?
Here is a way to re-check if you correctly setup the SSL for your domain with Cloudflare:
Can you check what have you got selected under SSL tab at Cloudflare dashboard? Is it Full SSL or something other?
If any other issues appear, follow the needed steps for troubleshooting from article below:
In case you do not have an SSL certificate, you can use Cloudflare SSL, if so, kindly make sure you follow the instructions as follows on the below article to setup an SSL certificate using Cloudflare CA Origin Certificate: