“You can’t do those two things at the same time,” Mr. Gordon said, and in Mr. Trump’s policies toward the conflicts in Syria and with Iran this fall “that enormous contradiction is coming back to haunt him.”

Critics say that the Trump administration has been inconsistent toward the Middle East before. When Persian Gulf neighbors sought to isolate Qatar in 2017, members of Mr. Trump’s cabinet urged them to end the dispute but the president himself applauded it.

He later ordered airstrikes against Syria to punish its government for using chemical weapons against rebel groups but he failed to respond after Washington confirmed another use of chemical weapons earlier this year.

When a Libyan militia leader launched an attack on the country’s internationally recognized government six months ago, Secretary of State Mike Pompeo spoke out against it. President Trump, a few days later, announced that he had called the militia leader and commended his “ongoing counterterrorism efforts.”

Mr. al-Rubaie, the former Iraqi national security adviser, said that two wars, billions of dollars in spending, and the expense of thousands of Americans lives should have made Iraq the “crown” of United States policy on the Middle East. But Mr. Trump “doesn’t see Iraq” and instead focuses only on the degree of Iranian influence.

The Iraqis “feel let down. They feel that these people have left them and left the country. They left them high and dry,” he said.

“For the Americans, their friends are disposable,” he said. “The Americans, you look for them and they look for the closest exit. You turn around and you don’t find them.”