The officers IMHO determine courts martial. Some may do informal, others formal. Could be as simple as Lee's influence or the number of former officers from the Union or West Point grads.
Yep. This is a story recounted decades later by my relative, Lawrence Daffan of the Fourth Texas, and published posthumously. This takes place after the retreat from Gettysburg in 1863:
We then marched to Culpepper, where we camped a while, then on to Fredericksburg, thence to Port Royal, where we camped some weeks.
While at Culpepper we had something of a riot in our regiment, caused by one of the regiment being ordered to wear a ball and chain, which we thought was a disgrace to our regiment and to the State of Texas. A number of us boys, who did not know any better, attempted to take him from the guard. Charges of mutiny were made against twenty-five of us, and we were put under arrest. Our captains were responsible for our appearance at court. This relieved us from drill and every other duty for six weeks of the summer.
Our trial was ordered to take place at General Longstreet's headquarters, at Fredericksburg, in the first days of September, 1863. We were then camped at Port Royal, twenty miles east of Fredericksburg. We were all ordered to report to General Longstreet's headquarters, near Fredericksburg, to be tried. On the way there I stopped at my uncle's home, Champ Jones, twelve or fifteen miles from Fredericksburg, and did not arrive at Fredericksburg until after my "crowd" had arrived there. In going, I was alone. There was no guard with any of us. In looking for the headquarters where I might be tried, I went to the camp of the battalion of artillery, and the major commanding met me. I asked him to tell me where the General's headquarters were, and he said "At the Reynold's place, a large, white house about a mile away." He said, "What are you going for?" I said, "I am going to be court-martialed for mutiny." He said, with astonishment, "What, looking for a court to be court-martialed? That beats everything I ever heard of." I said, "yes," and he replied to go ahead, that he didn't think I would be shot. I was then eighteen years old. We were all cleared through the influence of General Lee.
I have no idea as to the truth of Daffan's account, but stories like his added immensely to the Lee's reputation among the men who served under him.