Tail wagging the dog
If you describe a situation as the tail wagging the dog, you mean that the least important part of a situation has too much influence over the most important part. Eg: ‘Steve thinks we should buy an orange carpet to match the lampshade but I think that would be a case of the tail wagging the dog.’ – Cambridge English Dictionary
The expression comes from the saying that ‘a dog is smarter than its tail’, but if the tail were smarter, then the tail would ‘wag the dog’.