This edit should have been rejected. The edit was changing the meaning of the post. Edits (from anyone other than the author) shouldn't change the actual content, they should only help others read the content of the original author by improving grammar, spelling, formatting, etc.
The only possible difference that I might have done is used "radical change" as the rejection reason, as the major problem here is that it's altering the OP's meaning or intent. There is a fair bit of overlap between that and "invalid edit" though. "Invalid Edit" isn't wrong, it's just not quite as good of a fit in my eyes.
I have rolled back the edit since it is entirely invalid. (Unfortunately there is no way to have the 2 rep points reversed, or to adjust the users approve/reject ratio as displayed in the review queue and as the metric used to block users posting many invalid edits. The best we can do is ensure the actual content that they've changed is fixed.)
If the code is in fact incorrect, or in some way does not answer the question without this change, then the appropriate response is to post a comment for the author to change it (which had already been done), or to downvote the post (or both).