bark up the wrong tree - Phrases/Idioms
The American Heritage® Dictionary of Idioms by Christine Ammer. Copyright © 2003, 1997 by The Christine Ammer 1992 Trust. Published by Houghton Mifflin Harcourt Publishing Company. All rights reserved.
Waste one's efforts by pursuing the wrong thing or path, as in If you think I can come up with more money, you're barking up the wrong tree. This term comes from the nocturnal pursuit of raccoon-hunting with the aid of dogs. Occasionally a raccoon fools the dogs, which crowd around a tree, barking loudly, not realizing their quarry has taken a different route. [Early 1800s]