This is further complicated by a history (yes, in the US) of not just failing to prosecute obvious war criminals, and of pardoning many who do somehow manage to get convicted, but wide swaths of the population treating them as
heroes. There are recent examples, but look at how we treated those with the most direct culpability for the My Lai massacre, and further, how the guy who took direct action to stop it got treated—this stuff goes back quite a bit, we pretty consistently don't just tolerate but
coddle war criminals, so... risk disobeying the illegal order and maybe get treated like a villain, or become an actual villain but good odds you get hero treatment?
The law is arguably not what's written, but what actually happens, and analyzed that way our laws about war crime are complicated.