First of all,China is not your rival, it's enemy.i thought that China has forget about war but doklam showed us that any settlement is simply not possible.china is old friend of pakistan and despite pathetic pakistani economy,they are standing with pakistan.just think it for a second! Do you really believe that China is your rival and it can ditch pakistan for India? I think for China,interest is important than money.china is interested in pakistani gwadar and not in indian ports.why? Same trust issue.there is no such deal.remember China still calls Andhra Pradesh and ladakh it's part which is dispute.also Pakistani military is much closer to Chinese military and we regularly train with each other.china is not a traitor and I am sure about that.The fact is India and China were never enemies. In our long history of 5000 years we always co-existed peacefully. We had thriving trade relations, Chinese pilgrims visited here regularly, there students used to come here for studies, we have given them Buddhism faith all in all China and India always had deep cultural, economical and academic relations. Only for a short period of time ( 1958-1986) we had some confrontation due to bad policies from both sides. Even today our relationship is of rivalry not of enemies. The difference between rivalry and being enemies is that rivalry could be positive and constructive for both sides. With advent of trade war Chinese have understood clearly that western world in general and USA in particular will never allow any other country to rise to their level hence they are the true enemies. That is why now China wants good relations with India for mutual growth plus given the fact that western market is increasingly getting closed for Chinese products they will never want another big market of 1.3 billion people to close for them too. Also for the full consumption of their manufacturerd goods they would also need that Indian people have enough purchasing power hence bigger economy of India hence growth of India. That is why they now want mutual growth for China and India for their rise.
Another important point is OBOR can never be successful without India joining it due to its strategic location in IOR and Chinese will also be wary of chances of sabotaging of CPEC by India if it's concerns are not addressed. You have correctly summed up that biggest reason of these problems is border dispute resulting in trust deficit. Hence to solve this issue Chinese are offering early settlement of border dispute and neutrality in case if India try to regain POK through some hard measures. That will end the trust deficit hence the chances of sabotaging of CPEC plus it will give immense benefit and credibility to OBOR due to India joining it.
Now with keeping all this in mind do you really think China will prefer a failed state of Pakistan that is just a liability for whole world and is also indulged in terror activites in China over the immense economic benefit which China is in dire need due to trade war?
I think you don't need to be Sherlock Holmes for getting the right answer.