I know exactly what you're referring to and recall having this same problem myself. I discussed it with David Berkman in a lesson and here's the advice he gave me. This only works for pianists, but I'll describe a couple other techniques too.
When improvising on the piano, play the lines in both hands. Play through the form, and improvise such that your right hand is "leading" the left hand. When creating lines, let them flow from your right hand. Then switch the second time through the form. Let your left hand "lead" the right hand. When creating lines, think about your left hand and where it's moving, and let the left hand guide the right hand. This might seem strange or arbitrary, but there's an objective measure for whether we're doing it correctly. For most pianists, the right hand is stronger in improvising than the left hand. As a result, when my right hand was "leading," there were instances where my left hand couldn't keep up and missed the line. But when I switched and created lines using my left hand, I rarely had the opposite problem where my right hand couldn't keep up. This is a good gauge: if I am truly letting the left hand be the creator, then there are far fewer instances where the left hand struggles to keep up.
On guitar or another instrument, you can try something Jamey Aebersold once told me. Practice singing a solo without playing along on your instrument. After singing a lick or singing 8 bars, go back and replicate it on your instrument. This breaks the link between voice and finger. When I used this technique, I wasn't simply singing what my fingers already knew, because my fingers weren't moving.
But in addition to these techniques, which can be helpful, I realized that there was a deeper issue creating the problem you describe. My fingers had become so accustomed to certain movements (licks, patterns, etc.) that my brain turned on autopilot and just followed along. I played the same licks over and over and simply sang those licks which had become so rote. It turns out this was an issue of imbalance. The problem disappeared when I began learning new bebop heads systematically in all 12 keys at different tempos. By continually practicing new material and always focusing on all 12 keys (including those where I was much weaker), my fingers gained greater flexibility and freedom. Before, those licks were so entrenched in my muscle memory because they were so much easier to play. But with this practice, those licks lost that special status. I was strong enough in my technique that it was just as easy to play practiced licks as it was to play new licks I might come up with on the spot. It felt like I got out of the rut of my limited muscle memory by strengthening the areas where I was weaker.
I definitely recommend this routine. I would choose a new bebop head, start really slow (e.g., quarter note = 70 BPM), play the head in all 12 keys, the increase by 2-3 BPM, go through all 12 keys again, and continue until I reached ~220 BPM.