Your ancestor's CW pension file may contain more details about his Confederate service. Like my ancestor, he may have had to file an affidavit to avoid being dropped from the pension rolls when it was found he had served in the Confederate army.
Based on my ancestors pension file affidavit, the following is a rough timeline of his capture, imprisonment, recruitment/service in Tucker's regiment, desertion/"escape" from Confederate service, and return to his former Union regiment.
--------------
Oct 2 1864 - As a private in the 8th OVC, he is captured while burning rebel property near Luray VA as part of 2nd Cavalry division's raid on Page County.
Oct-Nov 1864 - POW: He was first taken to Libby in Richmond, later transferred to Salisbury Prison where "by reason of starvation and sickness, at times being almost without food whatever, he became very much emaciated, wasted, and weak". He remained imprisoned at Salisbury until 1 Dec 1864 when he was granted parole for volunteering to serve as Private in Tucker's Regiment CSA.
Dec 1864: Transported by rail to Columbia SC where he and fellow POW recruits joined the encampment of Tucker's Confederate Regiment already in training on the front lawn of Mary Chestnut's residence. He was assigned to Company I commanded by Capt. Charles B Day.
In late December, the regiment was transported by rail to Charleston SC "where we performed no service"
In January, he and much of the regiment were transported to North Carolina, though many of the recruits needed hospital treatment for a variety of ailments. Many, including my ancestor, were treated at Confederate hospital #11 in Charlotte.
Feb 6, 1865 - Feb 23, 1865: Much of the month of February was spent being treated for frostbite at a confederate hospital in Charlotte NC.
March - April 1865: After his release from the hospital, he served on a detail building corduroy roads in Central NC during the final month's of the war. He deserted "at the first opportunity that presented itself" prior to Johnston's surrender at Bennet Place on April 26. "Traveling by night, and hiding by day", he made his way to Union lines where he reported to General Kilpatrick. The General issued him a pass to return to the 8th OVC.
May-August 1865: He rejoined the 8th Ohio Cavalry in West Virginia, and served with them until they were mustered out in August.
-------------------
Like my ancestor, yours may simply have deserted when the opportunity presented itself, and made his way back to Union lines. If he had been captured while serving with Confederate troops, I imagine he would have been court martialed rather than being sent back to rejoin his regiment.