Danny O’Connor, the Democratic nominee in an Aug. 7  special congressional election, has a stock answer when asked about Nancy Pelosi: He won’t support her, and his party needs new leadership. On TV, in debates and in the mail, O’Connor has said he would oppose Pelosi, just as Pennsylvania Rep. Conor Lamb and a number of swing-state candidates have.

On Tuesday, O’Connor took that message to the D.C. studios of MSNBC’s “Hardball.” Chris Matthews, the show’s host and a former congressional staffer, has frequently tried to trip up Democrats by asking whether they’d really oppose Pelosi if there was no other candidate for speaker.

“The first vote you have to cast when you become a member of Congress is to vote for the member who’s going to become speaker,” said Matthews, with his arms folded over his chest.

“I don’t know who’s going to run,” O’Connor said.

“Pelosi’s running for reelection,” Matthews said.

“We need change on both sides,” O’Connor said.

“You’re not voting for Pelosi?” Matthews asked.

“No,” O’Connor replied.

In other interviews, that answer has usually finished off the topic. But Matthews kept pushing, asking six more times whether O’Connor would back Pelosi or whether he’d vote to let Republicans control the House.

“I’d vote for whoever the Democratic Party puts forward,” O’Connor said.

That answer quickly became the first gaffe of the low-key Ohioan’s campaign. The Columbus Dispatch, whose editorial board gave O’Connor a boost with a surprise endorsement, published a straight news story about how “after long dissing Pelosi, O’Connor now says he could vote for her as speaker.” Ohio Republicans accused O’Connor of lying about his position. On Wednesday, the Congressional Leadership Fund cycled in a TV ad about the Pelosi comment that transitions from Matthews’s question about Pelosi to O’Connor’s answer about the speaker vote, six questions later — making it look like he had affirmed his support for Pelosi.

The trouble comes from the two-step process both parties use to elect the speaker of the House. After every election — usually in mid-November, but on Dec.  5 for Democrats this year — both parties meet in conference to elect their leaders. In January, the party puts up its leader in an election for speaker. To win the first vote, a candidate needs only to get the support of a majority of his or her party; to win the second vote, he or she needs 218 votes in the House.

In November 2016, Pelosi faced the largest intraparty rebellion of her career, after Rep. Tim Ryan (D-Ohio) challenged her and secured 63 votes. But in the January 2017 vote for speaker, Pelosi lost only four votes — two of them to Ryan, two to protest candidates.

Republicans greeted O’Connor’s stumble with joy, with the Republican National Committee sending reporters a list of other Democrats who had pledged not to support Pelosi, urging them to get fresh questions about whether they would oppose her in conference or on the floor in January.

That’s a weeds-y question for most local House race reporting. But it gets to a problem for Democrats. In December, the party faces one of three outcomes in its House elections. One: It could still be in the minority, making the speaker question moot. Two: It could muster the votes to oust Pelosi as leader, picking another Democrat who will be its candidate for speaker. Three: It could nominate Pelosi over the objections of her critics and newly elected Democrats who had pledged to oppose her — Democrats whose first vote in January 2019 would break a promise to their voters.