I thought of that when I read your post. An official discharge may have been seen as an unnecessary formality.
And the records were so bad in the Confederacy, particularly towards the end of the war, that somebody might have been marked as “deserted” just because somebody else lost the muster roll, or couldn’t be bothered to complete it . . . . I could see it happening easily, I went through acres of those records when I was writing my thesis, and the standard of bookkeeping just got lower, and lower, and lower (not to mention the quality of the ink and paper).