When clients hire a contractor, they would proactively think how to defend their hiring decision if ever the selected contractor can't deliver product or performance as desired. They would normally hire contractor with good reputation and strong team, made up of seasoned professionals, etc. That would be one of the reasons that your prior firm fired you but hired a more experienced programmer.
If you work for such firm, you need to think about building up some relationships with clients you serve, not just your boss. Client's comments are sometimes much more important than those of your boss.