You can only learn from your own mistakes. I think everyone can agree with that. However, no one wants the people that make mistakes in their team.
The moment you make a mistake, the company wants to fire you. They don't think for a second that now you are of those who made a mistake and learned a valuable lesson. Instead you are rejected. Your next employer will call your current employer for a reference and they will tell them how you screwed up. No one wants to work with you.
When you screw up, you learn what you did wrong and are less likely to repeat the same mistake again. Despite how humble it sounds in a proverb, it can be the sole reason for getting you fired at a job.
Unless you are lucky of course. I'll call myself lucky because I've only gotten fired once... or twice. Yet I can't count the number of mistakes I made, not even with both hands. I made the mistakes that got people fired, yet I didn't get a slap on the wrist. So yes, I got lucky.
The turn around is, even though I didn't get fired for it, I learned my lesson. The day I deleted the entire code base before deployment, I learned the price of making such mistake. I documented the problem, I taught the new hires about it, and showed them what to do in case accidents happen. Overall everyone benefited from my mistake.
There are bigger screw ups. Like causing problems that end up costing large sums of money. At the airport, if you forget to double check a travelers passport to see if they have a visa, it ends up costing the company tens of thousands of dollars. As a result, they immediately fire the employee who made the mistake.
What they don't realize is that the employee that made the mistake is less likely to repeat it again. The employee understands the price of his mistake and will do whatever it takes to not screw up again. Yet, the airline fires him and hire a new employee that don't know the cost of making a mistake.
The cycle continues and those who have experience never get to use their new knowledge, because they get fired.
A mistake is just another word for experience. Yet it is one of those things you have to pretend never happened. It's ok to say you worked at a bank for 5 years, but you get a red flag if you say you gave a customer an extra $100 bill. If you rode a bike for five years and never fell, then you probably never removed the training wheels. Remove it and take the chance to fall. When you do, you will learn what to do once you are on the ground.
For us humans, making mistakes is our only way to learn. Yet we are punished for learning. We create controlled environments called school, where we learn theories and everything but experience. We are shielded from the real world.
I want to imagine a future where making mistakes is encouraged, then you will truly have a place to practice your experience.