Learning the notes on your guitar is a very important thing to do.
When you play barre chords, power chords or scale patterns knowing your notes will help you find your start position or root(tonic).
A good knowledge of the guitar also helps working out harmony and how to put chords together.
In fact a thorough knowledge of your guitar is paramount if you wish to break out of ruts.
Scales and their patterns can be awfully restricting when you play.
Knowing your notes can break these patterns, it allows you to use your brain as well as your ears.
Why learn the notes on the guitar when you play by ear?
In my view everything you can do to improve your playing and musicality is valuable.
Combining instinct with knowledge puts you in a much better place musically.
I play primarily by ear but sometimes the ‘theory’ side of my brain can help me break out of musical ruts.
It can lead me away from playing the obvious.
By breaking patterned play and using your knowledge of the guitar neck can lead you in other areas outside of your comfort zone.