The phrase implies a mistake in approach or strategy, not just location or direction. Insisting on lower prices from that vendor is barking up the wrong tree; they value service over costs.
Pro Tip 2/3
Colloquial Usage
It's common in casual speech but may be too informal for serious or formal writing. You're barking up the wrong tree if you think I'm the one gossiping.
Pro Tip 3/3
Avoid in Formal
Don't use it in formal settings like business reports or academic papers. In the meeting, she suggested, 'Let's not bark up the wrong tree,' to her colleague's informal chagrin.