WASHINGTON — In Wednesday night’s debate, Donald J. Trump excoriated the American-backed Iraqi military offensive to recapture Mosul from the Islamic State, saying it had forfeited “the element of surprise” and allowed militant leaders to slip away.

“Douglas MacArthur, George Patton spinning in their graves when they see the stupidity of our country,” Mr. Trump added, invoking two of the greatest American commanders from World War II.

Actually, probably not, according to some military historians and senior officers, who said on Thursday that Mr. Trump’s armchair generalship revealed a fundamental lack of understanding of Iraqi politics, military warfare — and even some of the most famous campaigns commanded by MacArthur and Patton.

Unlike the top-secret raid by American commandos to kill Osama bin Laden in Pakistan in 2011, there are many good reasons to foreshadow an impending ground offensive, like Mosul, mainly to reduce civilian casualties, isolate the enemy and instill fear within its ranks, military scholars and retired commanders said.