bark up the wrong tree pursue a mistaken or misguided line of thought or course of action. informal
☞ The metaphor is of a dog that has mistaken the tree in which its quarry has taken refuge and is barking at the foot of the wrong one.
1969Alan BennettForty Years On For sovereign states to conclude agreements on the basis of a mutual fondness for dogs seems to me to be barking up the wrong tree.