It was bound to happen!
There were multiple shut-up calls sent to IK for not praising India's foreign policy publicly, but he wasn't listening and deliberately avoiding it. You can not do this. He directly collided with the pivot of Pakistan's non-kinetic strategic policies. IK stepped outside the boundary, which was disastrous at all levels. He was capturing the attention of the Indian establishment and govt corridors.
Indian mainstream media was covering IK since day one but once he starts praising India's foreign policy, there was an unexpected sudden change in the entire Indian media coverage, their narrative and tone. Certainly, it was an expected. As of now, the Indian fascist regime has already built favorable grounds with respect to Kashmir FP (by utilizing Khan's recent remarks) and you will see this in the upcoming general elections.
Rationally, we are aligned with the western establishment and their policies since the partition, however, Pakistan's military always stands like a fireball when it comes to their defined doctrine. They won't tolerate, and won’t compromise if you directly interfere in their policies regarding India. For the west, that's completely acceptable if they really need Pakistan’s irrational support. No one can force Pakistan's military to accept Indian hegemony in the region.
Khan’s anonymous intervention into the domain that was pre-established by Pakistan’s powerful military establishment was completely unacceptable to them. That was an unintelligent, and brainless approach on IK's part. Consequently, that was enough reason to thrash IK from the power without wasting any time. NS tried that twice, and both times he was thrashed by the powers'.
Everyone should understand that there is a reason behind the existence of Pakistan, there is a reason for having armed forces and there are enough reasons for having anti-Indian doctrine -- vice-versa.
What Quaid said, all good captions and quotes, who should run the foreign policy, Army should be under the command of PM and all that, in reality, Pak military owns the country and they are the ones who drive the state policy whether you like it or not. Once you deviate from it, you will face the consequences. IK absolutely did the right thing. Praising someone's independent policy won't make you a traitor however, in reality, our govt(s) are working under extreme pressure and hostility.