1. Question: Why must a doctor who accidentally kills a patient run to the city of refuge but not a rebbe who strikes his student and accidentally kills him neither the court executioner, who gives the proper amount of lashes and accidentally kills the sinner?
A. The Shulchan Aruch (Yoreh Deah 336:1) says that the Torah gave permission for a doctor to cure and it is a mtzvah, it’s part of pikuach nefesh, saving a person’s life… If he heals people without the permission of the courts and mistakenly hurts someone he must pay for damages, but if he got permission, he is exempt. However, if he accidentally killed someone he must go into exile in the city of refuge.
B. The Rambam in the laws of a Rotzeach/Murderer says that since the court executioner or rebbe accidentally killed the litigant or student while performing a mitzvah then he is exempt from escaping to the city of refuge.
Answer: The Yad Avraham answers that a doctor is different because he did not do any mitzvah if the patient dies but the rebbe was performing a mitzvah of teaching his student and the executioner was performing a mitzvah of following the court ruling, the person just happen to have died in the process of performing that mitzvah therefore they are exempt from running to the city of refuge.