Agreed but Pakistanis no longer needed for China to make other relations with these countries. You have 3 trillion dollars in reserve for crying out loud. You are the second largest world power. Do you really think China needs Pakistan for relations with Gulf except physical access.
You brought Xinjaing province. Wasn't China the one who asked Pakistan to take out Islamic terrorists present on their soil ?
BBC News - China urges Pakistan to expel Uighur Islamic militants
I agree with the gateway but again you just need their land and stable Pakistan so that there won't be any possible threat to your link with Gulf.
You also have interest in vast resources Pakistan has which Pakistan itself hasn't mined themselves. Also Pakistan is needed for your investment in Afghanistan and transportation of those resources.
Like I said, Chinese are master businessmen. No country has achieved so much faster than you. Its just because you know what is best for your national interest like every super power on earth.