Internal politiking is also one of the ways a project gets derailed and failure becomes almost certain since agendas form when the cracks show up.
Honestly, there is no solution against this and it will always happen. If this becomes a repeated experience at work, you just have to leave and it doesn't become your problem anymore.