You’re barking up the wrong alley

This is a conflation of “barking up the wrong tree” (making the wrong choice) and “up a blind alley” (at a dead end).  The confusion seems to lie in the shared word “up”, and that both idioms describe frustration and negativity.  “Right up my alley” may also be in play here, juxtaposing wrong and right.  And lets not forget those dogs that bark incessantly in alleys.