Following a dead end path, pursuing an incorrect lead or assumption.
If you think those gloves will convict your friend, you are barking up the wrong tree.
This phrase comes from the USA and originates in the practice of racoon hunting. Raccoons are partly nocturnal animals and are hunted with dogs. The raccoons often take sanctuary in trees. When the dogs spot them up a tree they stand at the base and bark - occasionally, in the dark, they get the wrong tree.