We wouldn’t accept the excuse because what China would be fighting for in your hypothetical would be bad, while what we’re fighting for is good. You can’t just transpose the hypothetical to suggest hypocrisy because there is none.
Neither of those is true of Afghanistan. The Taliban is quite capable of at least holding on, and the non-Taliban Afghani government isn't opposed to US support.
As evidence of this, President Ghani's reaction was to promise check and balances to reduce casualties, not kick the US out of the country.