Self learning is great, and it will give you experience and chops in both disciplines, but at the end of the day, you will hit many walls that only a formal education (or a good teacher) can give you.
I've written hundreds of (perhaps over a thousand now?) apps over the decades which are used in the real world to save/make businesses time or money. I would probably categorise myself as a 'fairly decent' programmer, but I know I would fail most whiteboard tests which have basic CS knowledge patterns. I often look at discussions right here on HN about machine learning or cryptographic patterns etc. and feel like a green newbie again because I find the technical conversations hard to follow.
To bring it back to guitar playing - I remember when I was in my first band in high school, I had no idea how to play a guitar solo, but a session musician visiting the school showed me the pentatonic scale, and how you could move it up and down the neck to suit different keys. Mind blown. Pick any standard 3 or 4 chord song and I could play a semi decent sounding solo over it. Forget theory or all that Jazzy stuff - I was on a roll!
But after many years, I discovered that I was simply playing the same thing over and over again in different keys. I wasn't really moving forward. I remember telling other guitarist that - "The _best_ thing I ever learned was the pentatonic scale, and the _worst_ thing I ever learned was the pentatonic scale...". I felt boxed in and felt that my skills had plateaued.
It wasn't until a couple of years ago that I started taking lessons from an experienced guitarist, that I realised what I had been missing on by omitting basic music theory from my vocabulary. I was astounded by the power of learning the differences in scales, and using modes, triads, augmented chords etc. Stuff that I thought was too 'intellectual' or that I believed would restrict my creative freedom actually proved to be the exact opposite. It was the first time I experienced the concept of "the more you learn, the more you realise there is out there for you to learn". A kind of reverse Dunning-Kruger effect?
TLDR: Self learning is great, but formal education is a force multiplier.