Being genuinely coerced into an action against your will doesn't leave you ethically liable for your actions - you need to have some intent and will to carry out your actions for any culpability in a philosophical sense[1]. As an example, if you were to hand someone a gun and tell them (in a manner which they fully trusted your honesty and intent) that you would shoot them and their friend if they didn't shoot their friend then... you're on really shaky ground philosophically - dismissing any scenario escapes (shooting your captor, disarming them etc...) you're left with three basic options, shoot yourself, shoot your friend, and refuse to shoot and have both yourself and your friend be shot - in this case it is logical and it should be a guiltless action to shoot your friend and preserve your own life (but it's complicated by our value system).
So, excusing part of an action due to a coercion to follow actions is valid, but every time we talk about this scenario in the real world you're going to have more options, maybe you doubt your captor would actually shoot both of you - in that case shooting your friend is back to mostly being your decision - the issue occurs when this grey story is converted to black and white and people paint themselves falsely as being unwilling participants. In WW2 US soldiers could have refused when asked to participate in concentration camps, it would have been severely inconveniencing and that counts for something, but they chose the easy route and that is a perfectly valid guilt.
[1] There is a rather sound argument to be made that evil and culpability is a false construct and that we should refuse to punish any bad actors beyond the point of discouraging recidivism. If there is a common good that we all share as a "known truth" then deviations from that truth can be considered to be impairments about seeing the truth and comprehending it which would lead any deviations from that truth to be understood as a need to enlighten their view of the truth. It's quite an interesting philosophical path to head down.