NJP [Non-Judicial Punishment] is punishment which a soldier accepts rather than demand a court-martial. There is no requirement to accept such punishment. One might question why Cook was not court-martialed for refusing a lawful order.
George Washington was compelled to punish recruits who attempted to leave service prior to the end of their enlistments. The fact that they volunteered for such enlistments in no way protected them from such punishment.
Similarly, though Cook volunteered for service, once he was issued ORDERS, he was required by military law to obey them if they were lawful.
Yeah, so?