What does his last service record entry say? That he was returned to duty? Then was he AWOL or a deserter? or just no records? The Union might not have bothered to take a sick man prisoner. In my experience they don't like to take anyone on who is going to burden their hospital/medical system, for example they won't muster in anyone who is sick or injured.
I have noticed that being sent to a hospital presents an excellent opportunity to desert. Some of my Winston Co. Alabama relatives were impressed into the Confederate Army on threat of their lives and that was their strategy. They were eventually listed as deserters. My deserter relatives never went home until the War was over, too dangerous. I don't really know what they did, but they probably stayed in Union held territory. Your relative could have stayed with the Union Army or had friends similarly situated. Not speaking of your family now, but there was a whole segment of residents in the Confederacy who were small farmers, many of Scots-Irish descent, who were pro-Union and didn't see any reason to support the slave holding Southern aristocracy at the cost of their lives. This type of Southerner was well known by the Union Army who sometimes enlisted them, but in any case was not in general hostile to them in Union-held territory because they were one less Confederate soldier to fight as long as they weren't with their regiment.
I sympathize, it's annoying not to know exactly what happened to him. But at least you do know he returned home. If he was sick then, he was probably sick the whole time and never recovered in Richmond.