Not exactly. They ruled the president cannot be prosecuted for illegal acts taken in the capacity of president. So it's more "he can do illegal shit and we can't stop him" and less "anything he does it automatically legal". So refusing an illegal order would presumably still be a valid route of action.
But from what I know about the military, they can just punish you in some other capacity even if what you did is technically legal. Ie reassigning you to some shit duty or miserable location.