Failed war in Afghanistan?
What exactly are you talking about?
In 2002, Osama Bin Laden was being housed by the Taliban.
The goal of the invasion was to remove the Taliban for power over Afghanistan, in order to either capture Bin Laden, or at least deny him safe haven, and push him out where we could get him.
This happened. Taliban is not charge of Afghanistan, and we got Osama just a few years later, because he wasn't being protected by the Taliban.
So... I don't what point you think you are making, but it doesn't seem to fit the facts.