President Biden did right by getting the U.S. out of Afghanistan but Rep. Barbara Lee — who was against the war from the get-go — says there was one HUGE problem … the execution sucked.

The Congresswoman from Oakland joined "TMZ Live" Thursday and praised 46 for getting U.S. troops out of Afghanistan because, in her words, there was "no military solution." She said adding 10,000 troops would have exacerbated the situation because it would have inevitably created another 20 futile years of military operations in the war-torn region.

That said … Lee didn’t let Biden off the hook. She took him and the administration to task over the execution. She called it "horrible" … adding the U.S. has a moral obligation to make sure Americans, allies and journalists alike have a safe passage out of Afghanistan.

Biden told George Stephanopoulos he had no regrets over the U.S.’s chaotic exit from Afghanistan, because he said they didn’t make any mistakes. Lee begs to differ … and she’s calling on U.S. troops to stick around until all appropriate personnel who want to get out … do get out.

Biden was grilled on whether U.S. troops might stay beyond the August 31 deadline. The prez initially hedged saying it depended on the situation … but finally relented and said he may keep troops there past the deadline until all Americans are out. He did not say the same for the Afghan allies who are at grave risk.

Lee — the star of a documentary, ‘Speaking Truth to Power,’ dropping Friday — says she doesn’t feel vindicated 20 years after opposing the war on Afghanistan. She made the argument on the House floor just 3 days after the September 11 attacks … and was the lone House member to cast a "no" vote authorizing then-President George W. Bush‘s actions.

Instead of feeling vindicated … Lee says she feels sad and wants to find a way to help such a bleak situation.