Hello Maxine and yes it is a bit confusing. Dandridge, Tennessee was about a mere 30 miles from Knoxville so easy enough to understand about the different capture sites.
There were two main theaters of war, the Eastern and the Western. There were others but these two were the largest. Tennessee and Kentucky and Ohio and Illinois and even Georgia were considered to be in the Western Theater.
Colonel William Hoffman himself originally a POW and captured in Texas at the beginning of the war was the Union Commissary General of both the Eastern and Western Theaters of War even though he held the rank of Colonel. As a colonel his authority was final even if the prisons commanders held a higher rank. Perhaps only Lincoln or Secretary of War Stanton had authority over Colonel Hoffman. His office was located in Washington, DC.
I believe it was in December of 1864 when things changed. Another man was put in charge of the Western Theater and he controlled the Western Theater of Commissary of Confederate prisoners. Please forgive me as I can't think of his name off hand. Colonel Hoffman was still in charge of the Eastern Theater.
The military prison at Louisville, Kentucky was sort of like a Wal-Mart distribution center for Confederates. They would stay at Louisville until a northern prison camp could accommodate them which was usually done by telegraph.
Another factor was the huge amount of Confederate prisoners taken at the Battle of Nashville on December 15 and 16, 1864. They too would be sent to Louisville by railroad. Your ancestor just happened to be at Louisville among the huge prison population.
The new Union Commissary of Confederate prisoners in the Western Theater may have been a bit unfamiliar with Federal procedures. I am only assuming this to be true and can provide no documentation to suggest he was at fault for the errors. I would imagine the huge Confederate population was also another factor in the errors or change of prisons.
In February of 1865 all that would change as William Hoffman was promoted to General and put back in charge of both the Eastern and Western Theaters of War.
Interestingly it was a bit common in December of 1864 and January of 1865 for Confederates to be assigned to one prison and yet sent to another.
Hope this helps.