Dear Camille,
Yes.
The two most obvious examples are Japan and Vietnam.
We didn't leave Japan until they had a government that was willing and able to defend Japan and partner with the US in opposing radicalism and terrorism as tools to install tyranny over humans.
We did leave Vietnam and Congress failed to support and resupply the South Vietnamese. Despite heroic efforts the South fell and radical tyranny and genocide were imposed on South East Asia. The reputation of the US was severely damaged, and this is one place that world opinion is worth worrying about.
Some moral choices are simple. Blowing up civiians and beheading journalists are among them. Anyone who hides behind geopolitical complexity on that one goes to the back of the class and keeps her mouth shut.