There’s a bright side to the collapse of the second Trump-Kim summit. Maybe the two leaders—who dreadfully miscalculated each other’s interests and pliability going into this get-together—will learn some lessons about what’s achievable in U.S.-North Korean relations.

The talks in Hanoi broke down when it became clear that North Korean leader Kim Jong-un would take no steps toward de-nuclearization until all economic sanctions against his country were lifted—and even then, he would shut down just one of his reactors and do nothing else, not even submit a list of how many weapons he had or where they were. That was too much even for Trump, who declared the summit was over with no results, not even a hackneyed joint statement.

How did this happen?

Kim thought Trump was so desperate for a deal—for a place in history and a distraction from his domestic troubles—that he would agree to anything. It is to Trump’s credit that he walked out upon realizing that Kim’s insistence on such an extreme, one-sided deal was immovable. But it is Trump’s fault for letting this near-inevitable disaster go forward in the first place.

One lesson Trump should draw from this cock-up is that previous presidents had a reason for putting off summits until their diplomats lined up all (or almost all) the pins ahead of time. If Kim wasn’t going to budge an inch until all sanctions were lifted, there never should have been a summit.

Trump was arrogant in believing he could fix everything in face-to-face banter; that only he could make a deal—not just a deal, but the deal of the century—and that the diplomatic corps was rigid and useless. His diplomats—and even his handpicked North Korea emissary, Stephen Biegun—had been meeting with Kim’s team for months, to no avail, mainly because Kim believed he could get a better deal if he waited for the one-on-one with Trump. Trump encouraged him to believe just that, saying he was in no hurry for his new best friend to begin disarming. On the eve of the summit, word went out that the U.S. would be fine if Kim declined to submit an itemized list of his nuclear facilities, which U.S. officials had previously deemed a prerequisite for further progress in these talks, and logically so—it’s impossible to verify disarmament without knowing how many arms exist at the outset.

The ultimate source of all these misjudgments is Trump’s belief that deal-making depends on personal relations and that he is a master of the nexus between the two, not just in the world of New York real estate—where he made his putative fortune—but in the world of war, peace, and diplomacy. Compounding this naivete was the additional delusion that he and Kim had become such good friends—“we fell in love,” he proclaimed in September—that a terrific deal would be in the offing almost automatically.

Not even the collapse in Hanoi seems to have shattered his romantic illusion: at the post-mortem press conference, Trump said that Kim denied knowledge of American student Otto Warmbier’s fatal ill treatment in a North Korean prison—and that Trump believes him.

Trump didn’t realize, as do most people who get into his current line of work, that good relations grow out of common interests, not the other way around—and, at the moment, regardless of how many chuckles Trump and Kim might share over a four-course dinner in Hanoi, the United States and North Korea do not have very many common interests.

So now what happens? At best, the two countries go back to where they were a year ago, before the mutual feasting on pageantry, the starry-eyed dreams of a Nobel Peace Prize and a Trump Tower hotel-casino on the beach at Wonsan-Kalma. Instead, midlevel diplomats will meet in a seemingly endless stream of conferences, making occasional spurts of progress (an exchange of liaison offices in each other’s capitals wouldn’t be a bad idea, whatever else happens), followed by frustrating bouts of stagnation. In the meantime, North Korea (again, at best) will extend its moratorium on testing missiles and nuclear devices, South Korea will expand its programs of economic aid and investment, the United States will look for even the slightest crevice of an opportunity to reduce tensions further while also shoring up its alliances in the region.

On Thursday morning, those allies and many in the U.S.

foreign-policy establishment —the “swamp,” as Trump once derided them—were relieved that the president didn’t give away the store in Hanoi, as they’d feared he might. At the same time, some are nervous about what comes next. Trump doesn’t seem the sort of person to take stock, acknowledge misperceptions, and change course. He has also lost the opportunity to wave the banner of peacemaker as a counterpoint to the large-font headlines sparked this week by Michael Cohen’s testimony, much less those awaiting the report from Robert Mueller.

In fact, the failure in Hanoi threatens to solidify Trump’s legacy as a peace-wrecker. His “maximum pressure” campaign against North Korea may have brought Kim to the table—but couldn’t secure even the slightest concessions. His abrogation of the Iran nuclear deal only further isolated the U.S. from its traditional allies and may have strengthened hardliners in Tehran. His withdrawal from the Trans-Pacific Partnership bolstered China’s economic leverage with other Asian powers. He might now put all his chips on the trade talks with China—though his dejection in Hanoi may push Chinese President Xi Jinping to toughen his negotiating position, believing that Trump is now more desperate for a deal with him than ever.

And what of Kim? As the dynastic leader of a totalitarian regime who has murdered several suspected critics, including his uncle and half-brother, Kim is not susceptible to the domestic and bureaucratic pressures that the leader of a democracy routinely faces. But he will still have some explaining to do with the military and economic-planning elites, who were expecting him to deliver the “brighter future” of relief from sanctions and the promise of a peace treaty that would enshrine their nuclear deterrent.

Tense times are ahead. It’s time for diplomats to return to the fore. The question—one of many questions—is whether Trump will let them.