Minimizing mistakes and covering mistakes is what the best players do. There are no guarantees that you'll never make a mistake.
I go nights where I am spot on, I feel like I can't make a mistake, then someone else will flub, then I flub...maybe it's a sympathy error, who knows? Then other nights it seems like I'm covering up more of my own flubs.
The trick is, and this just comes with experience, is to make mistakes flow seemlessly into where the music needs to be.
I don't know that it's anything you can practice, it just comes with a lot of doing, but the better you know your fretboard, and your understanding of many ways to get around it, not just with scales, the easier it will be. Then you don't really think of your "mistakes" as a crippling device... it hapoens, you easily cover it, and move on.
Years ago I heard "If you make a mistake, do it twice so they'll think you did it on purpose."
While that's humorous, it's not too far from what needs to happen... when a misrake occurs, you have to be good enough at improvising to pull it into a something else.
Know your material by heart, know it so well you can do it in your sleep, really while thinking about other things.
When you've practiced your stuff thoroughly, and know it well. then let it happen on stage. If you try too hard you set yourself up for more mistakes.
It will happen... none of us have any magic other than what we are all imbued with.... You'll get there!