First, let's acknowledge that the editor's intent is a worthy one: They wanted to help the OP. That's great and that spirit of helpfulness rather than gatekeeping is something we want to foster. The means by which they did that may have been misguided, but the impulse to help is good.
A couple of things it's probably worth reminding ourselves of:
The goal of SO is to be a repository of high-quality questions and answers that are useful to other people in the future, not only useful to the person posting the question.
The reason for closing questions is that they don't support that goal.
That doesn't mean that helping the person posting the question anyway isn't worthwhile, just that it's secondary to the main purpose of SO.
With that in mind:
Question: Is this kosher?
No. The question box is for questions; answers go in answer boxes. A closed question is explicitly designed to not accept answers. So editing an answer into the question, even when well-meaning, isn't okay.
Question: Does this warrant rolling back the offending edits?
Yes, but I'd leave a comment for the OP along these lines:
@whoever, I've rolled back the edit that put an answer to your question into the question text itself. The question box isn't where answers go here on SO. But you can see that answer [here] in the revision history.
That way, the question is just a question, but the person that answer is aimed at knows where to find the answer in the short term, and gets the help the person editing the answer in was trying to provide.
If you have the expertise to know whether the answer really answers the question, and the question is otherwise on-topic, you might also consider voting to reopen.
Question: Does this warrant flagging for a moderator to intervene?
No. But if the person posting the answer-in-question edits it back in (rollback or otherwise), and you remove it again with an explanation in a comment why you've done that, and they put it back, flag for moderator attention and walk away. Don't get into an edit war or protracted argument in the comments.
FWIW: When I've really wanted to answer a closed question in the past and the answer was beyond what I could do in a comment, I've explained as much as I could in a comment or comments and then put the rest in pastebin or similar with a link. Yes, this means that content is off-site, which is also not kosher in the normal course of things, but the question is closed; the main goal is already not being achieved. So the comments (which are ephemeral) and link (which may rot) are just for the OP now, to help that specific person, not an enduring solution for others in the future.