The Chinese were angry at the time, IK did alienate key allies and had at that point lost the confidence of the establishment, who stopped propping up his coalition government.
Imran Khan was renegotiating certain CPEC projects which his government at the time felt were signed in a hastily fashion. The PTI government argued that certain projects weren't favorable from a Pakistani perspective. I agree that Imran Khan should have approached this more intelligently. Instead he went in with a stubborn attitude. Nevertheless, Imran Khan's government did reserve the right to approach China and renegotiate the terms.