Interesting topic!
A few years ago, I played some concerts and prepared very well in order to play almost perfect (or at least to have the guarantee that nothing would go wrong). I can say that there are absolutely no guarantees to play 'perfect', even your name is Zimerman, Michelangeli, Volodos etc. So I think the point is what you focus on. let's say very simple, the reason why I practise is to reduce the possibility of a disaster. But at the same time I realize that to be completely safe (as P. Anderzerwsky said) is often boring and you cannot be completely safe. Because music is something alive and live is never safe...
once I came to that realisation, I accepted that to have a certain guarantee is impossible, so I'm simply not striving for that. As I said before, when I am practising I am trying to reduce possibilities for a (musical or technical) disaster, when I am performing I don't think about it at all. I try to communicate music and simply see what happens.
about confidence, I think that grows by experience, I think it has not very much to do with any sort of guarantee. To give you one example, I performed the 4th ballade of Chopin many times. Of course the first time when I played it I was very very nervous and I struggled in the coda. Now I played it more then ten times (for public) and still struggle in the coda, but I am not nervous to play it any more. I just accepted that I could not play the coda perfectly. But I have the experience playing it for public and that makes me more confident, even if I don't play perfect.