I am also having the same error.
It was working fine until recently and I didn’t change anything in the PHP script.
I was getting 502 Bad Gateway error yesterday. Now I am getting 500 internal Error.
My website is on Volume vol18_1.
Recently I have resetted password from client area because I was facing issue like too many redirects when I tried to access phpMyAdmin.
Could it cause this?