Either the rejection was a mistake or I'm misunderstanding something about how the system works.
The latter. Edits to code should generally be rejected, if they change the meaning, unless they fix obvious problems with the code. The reviewers are not meant to have domain knowledge to verify the validity of the edit. The edit is somewhere in between: One has to know the language to see that it's a obvious mistake.
See also FAQ: When should I make edits to code?FAQ: When should I make edits to code?
Shall I just make the fix myself?
Since it's your answer, you can do whatever you want, so yes.