What do you think? Every O-2 in the country is a constitutional lawyer?
As long as the chain of command remains intact, the military will follow the orders of their immediate superiors, unless and until it becomes clear that their immediate superiors are acting outside of the chain of command.
In a military coup, done right, they will never get to know that.