Yes it is an interesting subject. Before it was two Union soldiers within the 3rd Maryland Cavalry who pretended to be Confederates who were really Union soldiers.
And there was also at least two Confederates who pretended to by Yankees within the 3rd Maryland Cavalry. These two Confederates were with the 43rd Tennessee and one was a corporal. He was on guard duty one night at Port Hudson, Louisiana he knew the pass words and counter words. He deserted and took his friend with him who was a private and crossed the Mississippi River and then was making his way home on the Natchez Trail and made it as far as in the Madison, Mississippi area and were questioned by Sheriff Taylor. They admitted they were Union deserters from the USS Essex and made it to Fort Delaware and then enlisted in the 3rd Maryland Cavalry. The private deserted but the former corporal stayed and received a pension after the war. Had it not been for his pension records we would never learned the truth.
By January 1864 Union authorities caught on to the Union deserters tricks as saying they were Confederate. Dozens were discovered within Fort Delaware and taken from Fort Delaware to Washington, DC for Trial. It took Union authorities a few months but they learned quickly.