Editing someone's incorrect code is not a good practice. If you think the answer has some issues, you can comment on the answer. If the author don't reply you, you can downvote the answer and add your own answer with valid code. So reviewers mostly reject such edits.