IANAL, but there is the presidential power to pardon. So the president could in theory give an illegal order (as long as it is an official act they have immunity) and promise a presidential pardon once the order is fulfilled (therefore extending immunity to the perpetrator). Meaning the president can entirely circumvent the UCMJ.
Ok yeah fair enough, that sounds reasonable. But to my knowledge the UMCJ is a federal law, not a state law, so how does that line of argument factor in there? You cited that as an example of checks and balances that would prevent people from following illegal orders, but it being a federal law still means the president could circumvent it with the official order plus pardon combo, at least if my understanding of this new supreme court ruling is correct.