Definitions of "lose" have been updated by firesteelrain to exclude retreating after failing to achieve anything.

The nation-building project ultimately failed. That is not the same as achieving nothing, nor is a political withdrawal the same thing as being militarily defeated.

You can also do Victory parades regardless of losing.

And you can label every political withdrawal a military defeat regardless of what happened on the battlefield.

US achieved major objectives, failed at building self-sustaining governments, and eventually withdrew.