State Representative Jeanette Nuñez, Mr. DeSantis’s running mate on the governor’s ticket, said Republicans prevailed because Floridians were not ready to accept a candidate like Mr. Gillum who campaigned on hiking the corporate tax rate.

“It can’t just be all charisma and a terrible platform,” she said. “Everyone, including Ron, talked about what a formidable opponent Andrew Gillum was in terms of his ability to appeal to certain audiences and his ability to communicate with average Floridians. But that will only get you so far.”

Democrats did have some reason to cheer: Debbie Mucarsel-Powell, a Democrat, ousted Representative Carlos Curbelo, a Republican, in the 26th Congressional District. Donna Shalala, a Democrat, will replace Representative Ileana Ros-Lehtinen, a Republican who is retiring, in the 27th Congressional District. The two Miami victories helped national Democrats reclaim the House and showed the party’s muscular strength in the state’s liberal southern end.

And they helped illustrate a crucial aspect of Florida’s seeming capriciousness.

“People have to remember that Florida is about five states in one,” Mr. Curbelo said in an interview on Wednesday. “South Florida and the Panhandle, for example, don’t have very much in common, beyond environmental issues and broad economic issues. Culturally, they’re very different areas.”

Democrats ran up their numbers in the cities. Voilà: Mr. Curbelo was out. Republicans outpaced Democrats everywhere else. Voilà: The third consecutive governor’s race went Republican, but only by a single point.

“I don’t think anybody can be thrilled or depressed with these results — maybe except me,” Mr. Curbelo said with a sad chuckle.

At least one person was happy: President Trump, who mocked Mr. Curbelo (whose name he mispronounced as “Cue-bella”) for failing to embrace him. Instead, the president praised Mr. DeSantis and Mr. Scott, whom he campaigned for last week, as examples of what can happen when he decides to campaign in a state he considers his second home.