That seems to be the problem that occurred in Germany in the 1930's and a lot of soldiers were later tried for crimes over.
Officers have the duty to know what the definition of a legal order is. As the Manual for Courts Martial clearly states: "An order requiring the performance of a military duty or act may be inferred to be lawful and it is disobeyed at the peril of the subordinate. This inference does not apply to a patently illegal order, such as one that directs the commission of a crime." Lakin was ordered to report to his brigade commander's office and ordered to report for duty with a unit attached to the 101st Airborne. Those orders did not involve any commission of a crim, so they were not patently illegal. The MCM further states, "...the commissioned officer issuing the order must have authority to give such an order. Authorization may be based on law, regulation, or custom of the service." Those orders were issued by officers authorized to do so by virtue of their rank and the position they were assigned to. The orders were lawful by any definition of the term, and Lakin disobeyed them. That's why he's being court martialed.