Typical partial-rationality. Humans are not robots. Having an accurate picture of your own flaws and the risks involved in most endeavors will not help you to perform better than having a slight overconfidence. We tends to overemphasize risks if we are made persistently aware of them. In every dynamic performance based activity, this tendency needs to be counterbalanced by a degree of irrational confidence. It's a feature, not a bug.
There are times when it is also harmful, but things like actually being able to talk to that girl, ask for that raise, close that sale, take down that oppressor...these things benefit tremendously from irrational confidence.
Removing all overconfidence would be the end of the human race.