Mistaken identity
Mistaken identity was a situation in which someone or something was mistakenly thought to be someone or something else.
In 2267, Nomad mistook James T. Kirk for Jackson Roykirk. (TOS: "The Changeling")
In 2268, Miles O'Brien mistook Lieutenant Freeman of the USS Enterprise for James T. Kirk during their visit to Deep Space Station K-7. (DS9: "Trials and Tribble-ations")
In the 24th century, the Flaxian Retaya was previously suspected of the murder of Dekora Assan on Japori II, but was exonerated on the basis of mistaken identity. (DS9: "Improbable Cause")
In 2372, Kathryn Janeway mistook Quinn for Q. (VOY: "Death Wish")