Former NYPD detective Bo Dietl walked out of the mayoral debate Wednesday night with something approaching surprise: “The mayor didn’t shake my hand,” he claimed to reporters.

This would not be a surprise if you watched the debate, the final one of the campaign, in which Dietl looked right at Mayor Bill de Blasio during his closing statement and said, “You’re a criminal.”

Where do we begin?

The debate started on a somber note with the mayoral candidates answering questions about the alleged terror attack in Lower Manhattan on Tuesday. Eight people were killed. These are the moments when politicians can rise or disastrously fall for the occasion: People want assurance, rationality, strength.

Republican Assemb. Nicole Malliotakis of Staten Island talked of supporting police officers in order to prevent terror and Democrat de Blasio said he favored intelligence gathering and working with alienated communities. Both were standard, party line answers. Then Dietl, who is running on his own Dump the Mayor line, started talking about the terror suspect’s beard and how he “looked like” a terrorist.

“Political correctness cannot be there all the time,” he said.

It was one way in which Dietl, who in a previous debate got so out of hand that his microphone was turned off, took a different tack from his sparring partners, particularly de Blasio.

They are opposites in almost every way — from height and temperament to policy on bikes, homeless shelters and jails. De Blasio allowed cell phones into city schools; Dietl is against them. Where de Blasio speaks in crafted sentences, Dietl uses the guttural punchy patois of a New York kid. He speaks of the “uneducation of our students” and claims “I love woman” despite his private investigator firm digging up information about women who claimed Roger Ailes, who was pushed out at the Fox News Channel before he died in May, harassed them.

At moments during the debate he seemed to be conducting a vaudeville routine more than an audition for the city’s top position: throwaway asides like “Who invented these bike lines?” and a proposition for how de Blasio can get some state support for a city initiative: “I’ll go with you to the governor, we’ll go shake him down, OK?”

This is the character Dietl has created

It’s a character that seems honed from a different city than the one de Blasio is courting for re-election. Make no mistake, Dietl is trying to court voters, despite what seems to be simple mugging for the camera (and his prospective movie career) on debate nights. As he said on Wednesday, he has traveled “all over New York City,” to sparsely attended candidate forums and senior citizen center appearances in places like Whitestone or Howard Beach. While de Blasio is so far ahead in polls that he can skip many neighborhood appearances for highly staffed and choreographed solo town halls, Dietl along with Malliotakis and former Democratic City Councilmember Sal Albanese wander in search of votes.

In those small appearances the questions are different. They’re about narrow issues like missing stop signs and noise pollution from helicopters, but also gentrification and fears about water bills and property taxes that got only a very brief hearing during the official debates. They are questions from people (a self-selecting group, naturally) who don’t feel helped by de Blasio’s efforts on affordable housing or the minimum wage.

In those appearances, you might hear some of the disgruntled concerns about city living that can make people fed up with incumbents. And when you’re fed up, you might at least listen to what candidates like Dietl are selling: a vision of an unruly city that only he can straighten out.

But that doesn’t mean many people will vote for him. De Blasio spent most of the debate letting Dietl go off on his tangents, and Malliotakis interjected when she could about her own differences with the mayor. Meanwhile, Dietl suggested that de Blasio is “fudging” the crime numbers.

Then he retreated into anecdote to back up the claim. “The teachers are scared, the parents are scared,” he says.

Because no debate this year would be complete without a brief mention of potential statue takedowns, Dietl castigated de Blasio about his tentativite answers on Christopher Columbus: “You should get your Italian heritage up.”

Maybe it’s not so surprising that the mayor didn’t want to shake.