We may not be talking about the right command.
At the end of December 1864, Major Peter Otey was commandnig officer of Wharton's Brigade in the Shenandoah Valley. An inspection of that brigade reports 177 officers and men present in the 30th Virginia Battalion, eight of those being under arrest. The report mentions many problems, but would surely not omit so great an issue as a significant number of men beng under arrest and taken to Castle Thunder in Richmond, quite some distance away.
Several other officers named Otey were then serving in Virginia.