I was facing this problem, everytime i tried to publish a post or save its draft i get this 502 error.
I was using a plugin SSL Insecure Content Fixer to turn ordinary http links into https links so i thought it was causing problem so i turned its settings “OFF” then tried, didnot solve.
then I disabled the Classic Editor then tried- it solved.
so, there seems to be a problem related how classic editor and ssl https link conversion works somewhere inside wordpress. I would request you to look into it.