But at the time of the trial the punishment WAS justified. The doctors said he had caused a miscarriage, and because of this he was sentenced to 1 year in prison. The fact that the doctor turned out to be wrong later is beside the point (and he was released as soon as this was discovered, so the punishment was annulled and no doubt he can sue the doctors for the 3 months that he was held). At the time of the trial, with the knowledge presented to the court, the judge made the correct decision.

So in answer to this question: What do you think, did he deserve this punishment or not?

Yes, at the time of the trial he did.