I served in the British Army. One of the lessons we had in basic training is about orders. What constitutes a legal order etc.
We were told we do NOT have to follow illegal orders, does not matter who gave it.
No more "I was following orders" defence!
POTUS is NOT immune to this.