The reason the Afghan "army" crumbled so fast is because they were the equivalent of a "mercenary army".
Multiple classics on political and military science talked of how fragile and undependable mercenaries are in wars, and we had this knowledge for centuries.
Once the US realized its blunders and did so to a degree that it actually committed to pulling out, to assure a safe pull-out it wouldn't need to just rely on itself, rely on Trump plan or Biden plan, or rely on a pointless mercenary army.
It would need to establish a comprehensive strategy involving all CSTO and SCO member-states and observers. Why? Because nobody closely or remotely bordering Afghanistan benefits from a botched-up US withdrawal aside from scoring short-term political points by laughing at the US. But the long-term problem remains - now the Taliban & Co. are a threat to everyone in the region. And ultimately, everyone in the region would have been interested in helping the US to withdraw pacifically, providing the logistics, the army personnel, maybe even the funds, to ensure a "safe exit" that wouldn't shake the entire region.
But to negotiate with CSTO/SCO the US would have to completely swallow its pride. And apparently pride is more important than safety. Or rather, ideological optics are worth more than human lives. Even American ones.