It's OK to screw up when you practice. In fact, if you never make a mistake, you're probably not taking enough chances or trying enough practice techniques. We need to venture into the unfamiliar and uncomfortable in order to grow.
What matters is that you recognize the mistake, learn from it, and let that be the last time you do it wrong. They say that once you come down with a specific form of the cold virus, you're immunized to it and you won't ever catch it again. This is only minimally helpful when you're young, because there are so many variations on the cold virus. But as you get older, you get fewer colds, because your repertoire of immunity has expanded. (Let it be known that I am not a scientist and that this could be a total myth. But you get the point.)
The same should be true of the errors you make, both in music and in life. Some mistakes are unavoidable, and some are spawned by ignorance of the correct way to do things. However they arise, they should be treated as a powerful opportunity to strengthen something about yourself that you weren't even aware needed shoring up.
Relish your mistakes. They're what will eventually make you great.