it’s (a case of) the tail wagging the dog
From Longman Dictionary of Contemporary Englishit’s (a case of) the tail wagging the dogit’s (a case of) the tail wagging the doginformalOPPOSITE/REVERSE used to say that an unimportant thing is wrongly controlling a situation → tail