I totally agree with you. This edit should rejected, definitely.
Is there any way to deal with these kinds of things, other than
sighing heavily and rolling back the edit?
I don't think so, unfortunately. When I look at the review history https://stackoverflow.com/review/suggested-edits/1851492
lc. reviewed this 1 hour ago: Approve
Jueecy reviewed this 1 hour ago: Reject
This edit is incorrect or an attempt to reply to or comment on the existing post.
Ben reviewed this 1 hour ago: Approve
ljh reviewed this 1 hour ago: Approve
David Olsson reviewed this 1 hour ago: Reject
There are 3 approve (lc, Ben, ljh) and 2 reject (Jueecy, David Olsson) votes. Seems like people might remained in this decision. Also Ben and ljh don't have too much revision activities, they might fall in wrong decision.
I think they just looked at the code formatted and approved it without any checking code content.
Could this be a side-effect of people grinding for reviewer badges?
In my opinion, YES!. Some people do unnecessary stuff just getting badges and this sometimes cause ridiculous stuffs..
Also might be related: