A student benefits from their attempt at a solution or proof being checked by the teacher. My own view is that, if the student's work is poor, it is best just to provide a model solution or proof in its place. In general, I think that bad work is best ignored and forgotten. The value of the failed attempt is that it has focused the student somewhat on the issues; he or she is then better prepared to understand and appreciate the good solution or proof.
An alternative view is that it is better to start from what the student has done: correcting and adding minimally so that the goal is eventually reached. Presumably the idea is to give encouragement by allowing the student to believe that they mostly got there and only needed a bit of help.
I don't like the alternative view because, even when the amended result is, in a strict sense, free of fallacy, the student is typically still left with a clumsy and badly written piece of work.
What I am seeking here is an argument for the opposing view and against my view, which I admit may be wrong.