It's true that we ought to be comfortable experimenting without fear of embarrassment, as well as to learn to tolerate more serious failure on occasion, and certainly unexpected failures can serve to draw attention to symptoms of deeper issues worthy of rectifying before they cause you even greater trouble down the road.
However, I will point to Richard Hamming's advice to learn from our successes rather than our failures.
"There are so many ways of being wrong and so few ways of being right that it is much more economical to study successes."
And:
"Study successes. If you study successes, when your time comes, you'll know how to succeed. If you study failures, then you'll know how to fail. So study success very closely: not only yours, but other people's. Why did Galileo do what he did? How did Newton do it? Try as best you can to study other people: how they succeed, and what the elements of their success are, which elements of that can you adapt to your personality. You can't be everybody, but you have to find your own method. Studying success is a very good way of informing your own style."
(The latter quote is from 25:30 of
https://youtu.be/a1zDuOPkMSw)