There are formulas for success and failure. Some people learn faster, some people learn slower; some lessons are better than others and get you there faster; some people are fortunate enough to be able to fail in more modest ways while they're simultaneously being successful in the grand scheme of things (Zuck). Sometimes randomosity bails you out of stupid choices, sometimes you hit the floor hard; the choice to learn or not is up to the individual either way.
Some people become successful early, and fail late. The list of former Forbes 400 members is littered with these people. Some people fail early, and succeed later, and for the rest of their lives, having learned their lesson.
In my experience, failure can feel a bit like living through a great depression. You become emotionally reflexive based on what you've learned / digested. Same way people learned to be extremely frugal after The great depression. If you learn the right lessons from it, your reflexes will keep you from making similar stupid mistakes later on. I don't know how you really learn those lessons without experiencing them (even if you do so in the 'fail small and often, while succeeding overall' manner).