I suspect that he had been paroled, released, and was at a Confederate exchange camp awaiting exchange.
This was a common procedure.