In English, quid pro quo refers to a barter-style exchange. I'll do this for you and you'll do something for me. There is this quote from the movie The Silence of the Lambs(1991) where Dr Lecter says:
[...] If I help you, Clarice, it will be "turns" with us too. Quid pro quo. I tell you things, you tell me things. Not about this case, though. About yourself. Quid pro quo. Yes or no? [...]
Of course this is basically about the "counterpart" to a "part" so to speak, more generally a reciprocal exchange, one could almost say a bargain, "something for something" (else, but somewhat equivalent).
But in Romance languages, another meaning has prevailed, "to take one thing for another" or basically the case of the mistaken identity(based on Collins translating the French word "quiproquo"; see do ut des for the English meaning equivalent as used with Romance lang.); more generally a mistake. As it relates to human beings, a typical scenario is when a person mistakenly assumes a "doctor" to be M.D. when they are in fact a Ph.D., based on some confusion or lack of information, and then starts acting accordingly(divulging personal details about their condition etc.). One can see how such a "device" or situation can bring comic relief to a stage play for instance.
Is there more a expressive/colorful idiom besides the "case of mistaken identity" which would carry that idea?