At the time of the bodge its likely the programmer was respected and in a position to fix the bodge later, The bodge being something demanded by someone higher up. The the higher up shifts the goal past and outsources leaving the bodge in place for eternity despite warnings from the programmer. Its unlikely the programmer did it to keep their job, more likely someone higher up with no clue thought they could save some money, or gain power by outsourcing something that could actually be done far cheaper in house if left to the people that know.
I've actually worked in one place where programmers have, by refusing to tell contractors what their work involves or sign new contracts to make them do that. That involved a small council IT dept with 1/10th of the people in their IT dept comparted with similar sized councils that outsourced.
Some people take their jobs seriously and are best left to get on with it where possible.