I think I may have narrowed it down a bit. I was unable to replicate the 502 errors on my mod/admin account, so I impersonated a user who had the problem and encountered it. When the user hits the submit reply button on a longer thread (4700 posts), the page sits on “saving” for a good 20 seconds before eventually failing to post with a 502 error.
Granting that user moderator status immediately fixes the problem. He was TL2, and granting TL3 did not fix it.