I’d leave that up to judge and jury with real details rather than hypotheticals, but I do think for justice to be accurate the state of mind, intentions, and many other factors should be considered.
I do think a person who was mentally competent, understanding the act is inhumane would get a more harsh justice than a person who wasn’t.
I think authority doesn’t have a direct role in deciding justice
I don’t think following orders is an excuse, each of us has a duty to understand what we are doing and are responsible for the results. but if a person was incapable of understanding the results of their actions that is different from a person who was.
A person who has authority likely is knowing and competent and intentional, and the wider impact of their actions will implicitly have harsher justice without directly considering their authority
Most countries have protections for people disobeying illegal orders, and most countries make inhumane acts illegal so I feel like this well covered.