Joni Ernst burst into national political stardom six years ago when she easily beat a cadre of more experienced rivals in a crowded Iowa race for the Senate by telling voters she grew up on a farm castrating hogs and would “make ’em squeal” when she got to Washington.

So it was a jarring scene when Ernst (R), now running for reelection, beamed into a virtual candidates debate last week from a studio a few blocks from the Capitol. Not only had the onetime Washington outsider established herself as a member of the GOP leadership and a frequent defender of the incumbent president, but this self-styled child of Iowa farm life appeared stumped when asked what many Iowa politicians consider a rite-of-passage question: the price of soybeans.

Democrats could not contain their glee.

“Sen. Ernst has had six years, and she’s forgotten Iowans,” said Theresa Greenfield, Ernst’s Democratic opponent, who has turned the tables on Ernst by accusing the incumbent of going native in Washington and embracing a range of unpopular Trump administration policies.

In competitive Senate races across the country, including states where Trump remains popular, Republican incumbents are facing a conundrum: how to prove their pro-Trump bona fides to a MAGA movement that sees many longtime Republicans as insufficiently pure while stopping the hemorrhaging among suburban moderates who wonder why they have enabled the president.

The result for Ernst and as many as a half-dozen of her GOP colleagues may be the worst of both worlds, in which they risk alienating energized Trump backers if they criticize the president but then, if they stick with him, lose some centrist voters who have soured on Trump and are open to voting for a Democrat.

The Fix’s Natalie Jennings analyzes the separate town halls held by President Trump and Democratic presidential nominee Joe Biden on Oct. 15. (The Washington Post)

Several of these Republicans are losing, or clinging to narrow leads, but almost all of them are performing just slightly worse than Trump, based on averages of polls dating back to Sept. 20 that measure support in Senate races and the presidential contest. How each candidate navigates the dynamic over the next two weeks could determine whether the Republicans hold on to the 53-47 majority that has, among other things, served as a critical defender of the Trump presidency and helped transform the nation’s federal courts into a far more conservative branch of government.

In North Carolina, for example, both Trump and Sen. Thom Tillis (R) are narrowly trailing their opponents, but the president has 45 percent support and Tillis has 41 percent, according to The Washington Post’s average of recent public polling.

Ernst and Trump are both narrowly losing in Iowa, but Trump pulls 46 percent to Ernst’s 44 percent, according to the polling averages.

In Georgia, Trump and Joe Biden are neck and neck, 48 percent to 46 percent, while Sen. David Perdue (R) has a narrow three-point edge. But the GOP incumbent’s average support is 46 percent, leading many strategists in both parties to predict that he will not reach the 50-percent-plus-one threshold needed to win a Senate race outright and will end up in a runoff against Democrat Jon Ossoff in early January.

Perdue appeared to be trying to excite the Trump base Friday night when he attended a rally with the president in rural central Georgia and intentionally mispronounced the first name of Biden’s running mate, Sen. Kamala D. Harris (Calif.), his colleague of nearly four years who would be the first Black vice president if their ticket wins.

He drew cheers from the mostly White crowd, while Ossoff immediately called it a racist tactic and raised more than $1 million online in the 24 hours following the speech.

Another Republican in a surprisingly competitive race, Sen. John Cornyn (R-Texas), explained the situation facing incumbents in an interview Friday with the editorial board of the Fort Worth Star-Telegram, likening GOP senators to women who think their boyfriends will change if they get married. The Post’s average shows Cornyn ahead of the Democrat, MJ Hegar, by eight points, twice the size of Trump’s four-point lead over Biden.

His relationship with Trump is “maybe like a lot of women who get married and think they’re going to change their spouse, and that doesn’t usually work out very well,” Cornyn told the newspaper.

“We’re not going to change President Trump. He is who he is. You either love him or hate him, and there’s not much in between,” he continued.

Public disputes with Trump usually lead to the president attacking those Republicans, causing a drop in support from his most fervent backers.

Cornyn believes GOP senators should do what he does when he has “differences of opinion” with Trump: “Do that privately.”

While there have been a few minor suggestions of incumbents trying to separate themselves from Trump, one GOP consultant privately dismissed that as a “fever dream” of Washington pundits. Instead, most incumbents are publicly tethering themselves to Trump in the hope that they can win over those last remaining pro-Trump voters to eke out victories next month.

In South Carolina, 79 percent of likely Republican voters had a “very favorable” view of Trump, but 54 percent hold Sen. Lindsey O. Graham (R-S.C.) in such high regard, according to a New York Times-Siena poll released Thursday. Graham’s opponent, Jaime Harrison, has pulled the race into a toss-up and is now spending from his massive war chest to encourage Trump voters to select a little-known third party conservative on the ballot instead of Graham.

After chairing the confirmation hearings for Judge Amy Coney Barrett, Graham told reporters that his vocal support for Justice Brett M. Kavanaugh’s 2018 confirmation gave Harrison a “national profile” because it made Graham a target for liberals everywhere, but that he intended to remain staunchly behind Trump.

“That made some people pretty upset on the left and I’ve been helping President Trump, but I trust the people of South Carolina to get it right,” he said Thursday.

Those who have sought distance from the president pay a price.

Trump on Friday launched into a Twitter tirade against Sen. Susan Collins (R-Maine), who has said she will not support any Supreme Court nominee until voters have spoken in the election.

Collins, first elected in 1996, is the rare Senate Republican on the ballot who has built her own brand and is running ahead of the president in her state. But Trump still maintains majority support in rural northern Maine, and any slippage for Collins among those voters would probably doom her chances in her race against Democrat Sara Gideon, in which she is trailing slightly.

Ernst, Perdue and others facing their first reelection bid face the toughest challenge for Republicans: trying to remind voters of their original outsider status, as Democrats accuse them of being Washington insiders.

“I will always fight for our farmers, because I grew up on a small Iowa farm. I will always fight for our veterans, because I have had my boots in that sand and I understand their valiant sacrifice,” Ernst said during the debate, reminding voters that she did a tour of duty in Iraq as part of Iowa’s Army National Guard.

In her campaign announcement video, Greenfield, a relative political newcomer who has worked in real estate development and urban planning, never once mentioned Trump. The president won the state by nine points in 2016 and is in a close battle with Biden there now. Greenfield’s campaign knew she would probably need some number of Trump-Greenfield voters to defeat Ernst.

Instead, the video showed images of Ernst standing next to Senate Majority Leader Mitch McConnell (R-Ky.) at one of his weekly leadership news conferences. It even included a clip of Ernst’s famous “make ’em squeal” 2014 commercial, turning it against her.

“Listen folks, she didn’t castrate anyone. She cast a vote to let the corporate lobbyists keep feasting like hogs at the trough,” Greenfield said in the video.

Ernst became a star in a caucus that has been starved for standout female conservatives for several decades now. McConnell chose her to deliver the GOP’s response to President Barack Obama’s 2015 State of the Union address, less than three weeks after she was sworn in as a senator.

When McConnell needed to put women on the Judiciary Committee — after his all-male lineup struggled with how to handle sexual misconduct allegations against Kavanaugh — he tapped Ernst to join the panel. That’s why Ernst appeared from Washington for the debate, having spent the week inside Barrett’s hearing room and not in Iowa.

After more than eight years of an all-male team of elected leaders, McConnell persuaded Ernst to run for a junior leadership post, and she won without any opposition.

Republicans believe Ernst still has enough personality to run ahead of the president in Iowa, and she is focusing on the tens of millions in outside “dark money” that Democrats are pouring into the state to turn the tables on Greenfield.

She calls the Democrat “Iowa’s leading benefactor” of these special interest benefits, with Ernst saying the donations should be disclosed.

“If you force those donors to disclose who they are donating to, to what organization, I can guarantee you the whole system would clean up quickly,” Ernst said during the debate. She defended her mix-up on the soybean price because she could not hear the moderator because of the technical difficulties that mired portions of the debate.

Ernst, however, faces a huge funding disparity with the Democrat in terms of the dollars each candidate can spend.

She raised $7 million for the third quarter, ending Sept. 30, which used to be considered a large sum. Greenfield has tapped into the anti-Trump liberal online world and brought in nearly $29 million, a jaw-dropping amount for the state.

In the final five weeks of the campaign, Greenfield is slated to spend more than five times as much as Ernst on the Iowa airwaves, according to GOP estimates.

And Greenfield plans to keep returning to the same message, over and over, that Ernst has changed in Washington, trying to drive a wedge between the incumbent and those die-hard Trump supporters who still want someone to make Washington squeal.

“I’ll never forget who I am,” Greenfield said in her closing debate remarks, “where I’m from and who I’m fighting for.”

Polling analyst Emily Guskin contributed to this report.