That probably was Brigadier General Frank Crawford Armstrong, from Aug. 10, 1861 to Aug. 13, 1861, although he served on both sides when he was still a Captain.
Jeffry D. Wert describes in in his book about "General James Longstreet : the Confederacy's most controversial soldier" that Longstreet had the same problem, but unknowingly for almost three months (March to May 1861), and knowingly for 8 days instead of just 3 as required in the question, therefore I will stay with Armstrong.
That would be Confederate Brigadier General Frank Crawford Armstrong - resigned from the Union Army August 10, 1861 after he served as Captain of a cavalry command at the first battle of Manassas and then went to join the Confederate army. His resignation took 3 days to process making him "technically" enlisted in both armies at same the time. https://emergingcivilwar.com/2013/10/04/fighting-for-both-frank-crawford-armstrong/
There are multiple generals that served both sides during the war (ie Pickett, Torbet) at the same time - but the 3 day clue makes this one General Frank Crawford Armstrong.
Robert E. Lee.
Lee resigned his General commission in the U.S. army on April 21, 1861 but it was not officially accepted until April 25th. Meanwhile he likewise was offered a Major General position in the Confederate army on April 21st and he officially accepted it on April 22nd, hence for three days he officially was a general in both armies! (Excellent question @sarladaise)
Robert E Lee, he penned his letter of resignation to the US on April 20, 1861 but it wasn't made official in the US War Department till the 25th. In the meantime on the 22nd he accepted Virginia's offer to command it's state troops so for three days he was technically on both sides. https://www.historynet.com/a-question-of-loyalty-why-did-robert-e-lee-join-the-confederacy.htm
When war broke out, Armstrong has risen in rank to captain and was in charge of a Union cavalry company at the First Battle of Manassas.
Approximately a month after the battle Armstrong had a change of heart and tendered his resignation from Union service on August 10, 1861 in Washington D.C. He then went south and joined the Confederate service.
Yet, the resignation took three days to process. So, not only did Armstrong serve on both sides during the war, he technically served both sides at the same time for three days!
Francis "Frank" C. Armstrong(1835-1909). Armstrong resigned his commission in the U. S. Army and joined the rebel army August 10, 1861. His resignation was not accepted until August 13, 1861, so he technically was on both sides of the conflict for three days.
Edit - Torbert was offered a commission as a lieutenant in the Confederate Army at the beginning of the war, but he refused it, so he never served on the Confederate side.