Regarding Cloudflare 521 error, may I suggest you to take a look into below article to troubleshoot the issue, therefore if you already did may I ask what have tried so far from the suggestions below?:
Maybe something at the Lightsail firewall changed or need to be fixed?
For example, kindly re-check if Cloudflare is allowed to connect to your origin host to as follows in the below article: