Barking up the wrong tree

To be totally wrong

Examples

Ethan relied on Ella’s opinion at first but then he realized that she is barking up the wrong tree.