Kirstjen Nielsen is off the island. The embattled, beleaguered and apparently overwhelmed secretary of the Department of Homeland Security was reportedly fired before she could quit.

Summoned to the White House on Sunday, she arrived with a resignation letter in tow. “Despite our progress in reforming homeland security for a new age,” it read, “I have determined that it is the right time for me to step aside.” But President Donald Trump was the faster draw, tweeting that she was out before she could post it.

In a sad effort to make this appear like a planned, professional exit, Ms. Nielsen later tweeted that she’d stay at her post until Wednesday to “assist with an orderly transition and ensure that key DHS missions are not impacted.” Wednesday. In other words, she was given 72 hours to clear out her things.

So far, the orderly transition includes a fight over the appointment of yet another acting secretary into the Trump administration, the ousting of the U.S. Secret Service director, and the expected departure of the head of U.S. Citizenship and Immigration Services.

Ms. Nielsen was in an impossible position. There are 22 agencies reporting into DHS, but her job performance was only ever going to be based on immigration. And the crisis at our southern border is the product of two competing narratives, both of them detached from reality.

The president has tried to paint the surge in migrants from Central America as a hostile invasion. The Democrats insisted, at least until recently, that there was no immigration crisis. The truth is that there is a crisis — a refugee crisis. Days before her “You’re fired” moment, Ms. Nielsen sent a letter to Congress all but begging lawmakers to take the catastrophe seriously, warning that the border security system was approaching the “breaking point.”

It’s not exactly blindingly novel to point out that the president’s criteria for competence is unconventional. To be sure, he likes good numbers he can tout at rallies and in interviews — jobs created, stock market highs, drugs seized, immigrants apprehended, etc. Those are fairly routine benchmarks. With a rising number of migrants inundating the border (and no new border wall to seen), Ms. Nielsen failed to provide much on this count.

But her political predicament was larger than that. Mr. Trump also demands — and rewards — loyalty, particularly in the form of effusive praise on cable news. Ms. Nielsen tried on that score, but she was never particularly convincing, often sounding as if she were reading from a script she didn’t like.

But there’s another measure of political value the president prizes in his lieutenants and surrogates: He likes a good foil. In foreign policy, for instance, Mr. Trump has played the disruptor, questioning NATO, blowing up trade deals. Meanwhile his foreign policy and defense team played a reassuring role, pushing the broom behind the bull.

In domestic politics, however, Mr. Trump loves controversy but struggles with confrontation. (That’s why he so often fires people over Twitter from a distance.)

From his lifelong admiration for Roy Cohn, the bare-knuckled brawler who served as his mentor, to his hiring of legal and political brutes like Michael Cohen and Corey Lewandowski, Mr. Trump enjoys it when others play the heavy for him so he can claim to be the nice guy.

Right now it’s White House aide Stephen Miller who is the ideological enforcer on immigration.

Mr. Miller is a consistent immigration restrictionist, opposed to legal and illegal arrivals, and when Mr. Miller has his ear, so is the president. But in his last State of the Union address, Mr. Trump blurted out — off script — that he wanted more legal immigrants than ever. Tellingly, when the border crisis first flared up last year, the White House zigzagged on its response. Was separating families at the border an intentional policy meant to deter further immigration or a regrettable result of something Democrats had done? Mr. Trump has been all over the map on the question. But Mr. Miller said it was intentional, while Ms. Nielsen insisted that it was outrageously “offensive” to suggest the administration would ever use family separation in such a punitive fashion.

This schizophrenic messaging is a byproduct of Mr. Trump’s tendency to use reality show tropes as a lodestar. “This is why I was so great on ‘The Apprentice,’” Mr. Trump told then-House Speaker Paul Ryan after his televised vow to take credit for a government shutdown in December. According to a report last week in the Washington Post, Mr. Trump added that the ratings for this Oval Office confrontation with Nancy Pelosi and Chuck Schumer were “great.”

Ms. Nielsen’s Achilles’ heel was that she was miscast for her role. She was mediocre at best at public displays of sycophancy, and she was even worse at playing the bad cop.

Mr. Trump has told aides he wants someone tougher on immigration policy. Whether he actually gets his bad cop remains to be seen. But odds are good that whoever it is will be better at playing one on TV.

Jonah Goldberg is a fellow at the American Enterprise Institute and a senior editor of National Review. His latest book is “The Suicide of the West.” Email: goldbergcolumn@gmail.com; Twitter: @JonahNRO.