I would say that ‘it’ refers to ‘incompetence’. If you refer to the consequences or existence of the incompetence, you would use ‘this’. Just a couple of points: the past tense of ‘lead’ is ‘led’. I would also rephrase 2 -
His incompetence angered his superiors TO SUCH AN EXTENT that it LED to his losing his position.