This deal must have been under negotiation between all 3 countries for some time. In litigation, you don’t negotiate if you have a sure chance of winning the case. Winners don’t negotiate.
If that’s the case then China should have sensed that the extradition might fail when approached by the US. It could have then let it play out, win the case and have a huge PR victory.
None of that happened, which means China had little Intel on what was going to happen. And all sides decided to negotiate and settle the matter in a mutually beneficial manner
Seriously, I don't think it's that hard to understand. If you had the choice to either be acquitted after 10 years of house arrest during the appeals process or be let out now with some meaningless comments and all charges dropped, you don't think 10 years of your freedom is worth negotiating for? On top of that, China does not have a history as the country that wants to totally humiliate and lay out its foes either; rather Chinese prefer to win silently, mercifully and to avoid forcing "a desperate dog to leap the wall" situation.
It is entirely plausible, although not confirmed, that Canada and the US sat down to talk before Canada convinced the US made this offer to Meng and she accepted. Even in your sentence, you said that China sensed that the extradition "might" fail; there are a lot of uncertainties in there that can go wrong in 5-10 years. On top of that Chinese-Canadian relationship is in deep freeze as long as this is not over and although I'll probably hold a grudge against Canada for the rest of my life, cooler diplomatic minds in Beijing understand that the US is the real enemy so it's time throw this whimpering dog aside to focus on the real threat, which can only proceed once the saga is over. Accepting this heavily Chinese/Meng favored deal makes a lot of sense.