Confederate company commanders didn't have access to documents like prisoner-of-war registers. These were compiled by Federal authorities, and the two warring governments didn't usually share information.
Confederate company commanders used the best information available to compile their rolls. That may have included accounts forwarded from home by friends and relatives writing to company members. However, in the absence of any information regarded a soldier who didn't return from leave, he had to be labeled a deserter.
Ordinarily Federal prisoner-of-war records include the description a captured Confederate gave himself. If during questioning a soldier described himself as a deserter, the Federal provost marshal processed this man differently than others captured with arms in hand. The provost marshal assumed deserters would be willing to take the oath of allegiance to the U.S. Otherwise, they were forwarded to prisoner-of-war camps with others taken in battle.
Options for Confederate prisoners-of-war --
1) Remain in prison until released by exchange,
2) Take the Oath of Allegiance to the U.S.,
3) Escape from prison,
Prisoners who took the oath could do so intending to enlist in U.S. service. Most enlisted for frontier service, while others joined the U.S. navy or some other military command.
Until the surrender of the major Confederate armies, Federal authorities didn't allow most prisoners to simply take the oath and leave prison. They presumed that Confederates would avail themselves of any means to leave prison and return to some form of armed resistance to Federal authorities ASAP. The oath was made available to deserters and prisoners willing to enroll in U.S. military service, but not to others until the late spring of 1865.