To be convicted of a charge of desertion, the court will have to find that he actually "deserted". I'm not saying that he didn't, but what did he intend when he walked away from his post? Did mere wandering away progress to an unintended capture or did he intentionally walk to the enemy and give them comfort? Of course, mere "wandering away" can be considered an offense too. The court needs to make findings of what actually happened, and convict him of the appropriate offenses.