Okay, sorry, but the previous answers have all missed the mark. The problem with your conundrum between these morality questions is that they are NOT analogous… not that a patient is safe, or owns their organs, or any such thing.
The difference between the two scenarios is that the objective action of pulling a train lever is not intrinsically wrong, while murdering an unsuspecting victim to harvest their organs is objectively morally disordered behavior.
That’s the second of the three key caveats of the principle of double effect: that the action taken is objectively neutral or good, and never intrinsically disordered. The first criteria is proportionality (aka, I can’t pull the lever if there are 4 people on one track and pulling the lever would result in 10 deaths instead). The last criteria is that I must be intending for the good to happen and not the bad (aka, I can’t be pulling the lever to kill the 1 because my motivation is payback against that guy for stealing money from me). A decision in these cases must pass ALL THREE criteria to be morally valid.
In both of your scenarios, the criteria of proportionality and intent are met, but in the surgeon scenario the objective morality of the act criteria fails inspection, and bars the surgeon from said action. Pulling a train lever, by contrast, is inherently a neutral act, which passes the criteria and allows for action to be taken.