If a programmer is consistently making mistakes that cost other programmers time and energy, and either incapable or (worse yet) unwilling when it comes to improvement, then he's a bad programmer and should be fired. No company can tolerate dividers.
It doesn't sound like this is what happened to the OP. It sounds like this was an occasional mistake. They happen.
If a run-of-the-mill junior programmer mistake is an existential threat to the company, that's management's fault. Either (a) it was too early to hire someone that junior, or (b) the infrastructure was poorly designed.