When a doctor assists in an execution, they participate in what is a murder, just under some other context. Lift that action up and out of the auspices of state and governance, and you have a murderer, accessory to before or after, or an accomplice to.
This isn't a particularly rare occurrence, but someone is there to cut the life short, do harm, and achieve a goal. Justice, revenge, passion, grudges aside. There's a winner and a loser.
It could be a misanthrope and henchmen, or it could be a doctor, somehow more distinguished than a common thug. The doctor chooses gets hands dirty for different reasons, there they are all the same. But the doctor gets to walk away from his murder, and commit more, so long as the state and government are not deposed.
And where is the line? Is the programmer who writes code for a surveillance drone ( immoral? What about one who writes code for a submarine that may carry ballistic missiles? Or for the missile guidance system itself?