What could be an idiom describing the action of looking for something in the wrong place?

Solution 1:

Bark up the wrong tree: can be used in that sense:

  • 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]

(AHD)