In The Good, The Bad and The Ugly, a character mislabels a union army because of dust on their uniform making him believe they are confederates. Did this ever happen in real life?

by NuclearCorpus
Obligatory-Reference

Misidentification wasn't uncommon, especially during the early days of the war when many units had different-colored uniforms. Notably, during the First Battle of Bull Run (July 1861), one of the turning points came when the 33rd Virginia (Confederate) regiment was mistaken for a Union unit. They were able to get close enough to decimate an infantry regiment and capture several artillery pieces, which (along with a charge by Stonewall Jackson and the arrival of some Confederate reserves) started the general Union retreat.