That's not true. Just look at Lt. William Calley.
He didn't serve additional time due to other technical issues in his prosecution.
"Howard Callaway, Secretary of the Army, was quoted in The New York Times in 1976 as stating that Calley's sentence was reduced because Calley honestly believed that what he did was a part of his orders—a rationale that contradicts the standards set at Nuremberg and Tokyo, where following orders was not a defense for committing war crimes.[98]"
[98] Marshall, Burke; Goldstein, Joseph (2 April 1976). "Learning From My Lai: A Proposal on War Crimes". The New York Times. p. 26.
Sure sounds like an excuse to me. Now that I think about it, you're not splitting hairs, you're just flat out wrong at best.
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.