We failed to accomplish any aspect of "the mission" in Vietnam but that is not the case in Afghanistan. We did, in fact, remove al-Queda, kill its leader OBL, and remove The Taliban from power. We gave Afghanistan a possibility to stop them from returning to power but they seem incapable of doing that. This is their fault, not ours, and the only d$A mistake was in staying to give them that possibility. The hurried bugging out is how most wars end because people become more vulnerable as numbers dwindle. At a certain criticle-mass it must be done fast. This might have gone a bit better if 45 hadn't pulled out most of the protectionary forces for a more orderly bug-out.
It's what happens after the transition. The question I never hear asked. Where would Afghanistan be today of the USA had never been there?
Run by a stable, popular, Pashtun, and remarkably uncorrupt theocracy. And they would be an isolated impoverished sanctioned pariah state like Cuba, North Korea, or Iran ... because that was US policy before we invaded. Good question.