Republican lawmakers thought they had it all figured out.

This summer, they voted to alter the state’s election law pertaining to some judicial races. Under the old system, the order of judicial candidates in partisan races was decided through a randomized process; under the new system, the candidates affiliated with the party of the governor would get top billing, which is where candidates in low-profile races like these want to be.

The move was rather nakedly designed to boost the fortunes of Phil Berger Jr., son of the Senate leader and candidate for the N.C. Court of Appeals. And it worked: Berger was first where he might not otherwise have been, and he wonbarely. So, too, did the four other Republican candidates for the appeals court. (Those judgeships are ostensibly nonpartisan, but the General Assembly passed a different measure this year that required party affiliations to be noted on the ballot, part of an effort to pack the state’s judiciary with Republicans.)

Cool trick. One problem: this law also appears to have helped elect Mike Morgan, an African-American Democrat from Raleigh, to the N.C. Supreme Court, even as Donald Trump won the state handily. Even more astounding, Morgan won easily, by ten percentage points. On the court, he’ll give Democrats a 4–3 advantage and can serve as a check on legislative overreach.

Here’s how that happened: while the appeals court races were partisan, the only Supreme Court race on the ballot wasn’t. Its order was still random, and Morgan got the top slot, over incumbent justice Robert Edmunds. He might well have prevailed because conservative voters, knowing little to nothing about these candidates but having seen Republican judges on top elsewhere on the ballot, assumed Morgan was a Republican. And that was how Morgan overcame an otherwise very good night for the North Carolina GOP.

Now, there’s no way to prove this theory. Maybe, for instance, people thought Republicans should dominate the state’s Court of Appeals but not the Supreme Court. And if this election taught us anything, it’s that voters are unpredictable.

But when you look at the numbers, the evidence is compelling. Statewide, Morgan took 54.45 percent of the vote, while Edmunds took 45.55 percent. Those percentages are nearly identical to several Court of Appeals races that went red. To name a few: Republicans Bob Hunter, Richard Dietz, and Valarie Zachary all won with an almost identical 54 percent. (Berger and fellow Republican Hunter Murphy were outliers: Murphy won a closer race, by three percentage points, though there was a third-party candidate; Berger Jr. won by half a percentage point.)

Those three judicial candidates, for example, won Lenoir CountyHunter by five points, Dietz by two, Zachary by two (Berger Jr. lost Lenoir)which Trump won by five points and Governor McCrory won by seven. Morgan won the county by nineteen points.

Another example: Rockingham County. Trump and U.S. Senator Richard Burr won there by about thirty points. McCrory won by twenty. Berger Jr. won by twenty-one. Murphy won by twenty-four, and Hunter, Dietz, and Zachary won by twenty-nine. Morganagain, a nonincumbent black Democratwon Rockingham by five.

One more: Cherokee County, out in the mountains. Trump won by fifty-six points. Burr won by fifty. All five of the Republican appellate court judges garnered north of 70 percent of the vote. Morgan won with 58 percent.

We could go on, but you get the point. Morgan appears to owe his upset victoryand Democratic control of the state’s highest courtless to a brilliant campaign strategy than to Republicans’ shenanigans backfiring.

To correct these backfiring shenanigans, however, Republican lawmakers appear to be consideringwait for itmore shenanigans. Specifically, according to numerous media reports (including from the INDY), lawmakers want to add two seats to the court in a December special session. The new justices would, of course, be appointed by the lame duck McCrory, thus maintaining a Republican majority despite the voters’ wishes.

Last week, Phil Bergerthe Senate leader, not the new appellate judgetold Capital Tonight that there have been “no discussions within our caucus about that issue.”

Which, while perhaps a dousing of cold water, isn’t exactly a hard no.