The concept you're describing is known as moral indulgence or moral self-indulgence: When a person refuses to do the right thing because they want to keep their hands clean. When you're standing at the switch you have agency and should be prepared to own your action. "Five people were struck by a trolley because I lacked the moral fortitude to save them."
The concept you're describing is known as moral indulgence or moral self-indulgence: When a person refuses to do the right thing because they want to keep their hands clean. When you're standing at the switch you have agency and should be prepared to own your action. "Five people were struck by a trolley because I lacked the moral fortitude to save them."
[0] https://cla.csulb.edu/departments/philosophy/wp-content/uplo...