Good, I can work with this. As far as the act of throwing the switch is concerned, while it is true that the outcome comes through the act itself, it is not in the act itself. That is, if there was not someone on the second track, and the switch was thrown, obviously no one would die. Therefore death is not in the act of throwing the switch. This is equally true of the surgeon, as while the death also comes through the act itself it does not exist in the act. This is why removal of the part of the body containing the fetus is valid, where the removal of solely the fetus is not. The death is not in the former act, but is in the latter.
Shooting someone is a direct cause of death. Throwing a switch is not. If it was, someone would die every time a switch was thrown. The latter is an act that (in this case) leads to a death, just as the excision of “diseased” tissue in the case of an ectopic pregnancy leads just as inevitably to a death.
Suppose someone was aiming a gun at person A, and just before he fires I knock his hand away to cause him to shoot person B. Am I responsible for the murder of B? Yes, my act lead to the death of B, but it seems a real stretch to claim that my act of saving A was intrinsically evil.