The scenario sounds familiar: Democrats, facing a Republican presidential candidate widely reviled among the party’s rank-and-file, nominate a seemingly safe establishment figure to keep their hold on the White House.

To the party’s shock and horror, their establishment figure loses the general election. The reviled Republican becomes president.

The...