Afghanistan was a failure decades ago while we sat there and watched the Afghans that were supposedly on our side escort osama out of Tora Bora. That was the reason for going there in the first place. Once osama was gone and al qaeda had fled to countries like Syria, Yemen, and other places there was no reason to stay. The failure started years ago. The entire Afghan mission was a failure because it didn't accomplish it's primary goal which was to capture or kill osama. That didn't happen until years after we invaded and it didn't even happen in Afghanistan.
Every President that was in power during our Afghanistan occupation failed. Bush, Obama, trump, and Biden. It was one big failure that happened under 4 administrations.