Disagree entirely, because I have!
A few years ago, I'd brought a song to the metal band I was playing in. We were going through it, and they said what happens next. Jokingly I said 'bass solo'.
No-one said 'No!', so I thought stinky poo, I've got to do a bass solo! Around 90% of it was made up on the spot based on theory.
I knew the chord sequence so bend up to root note - lazy rock player trick
Come down the natural minor
tap some triads, adding some diatonic passing notes
end on the root note.
Had I been playing just by ear, I would have had to take a minute to work some things out, as opposed to just been able to do it on the spot.