The feelings of betrayal seemed to begin about a year ago, when Representative Max Rose, a first-term Democratic congressman representing a swing district that includes Staten Island, voted in favor of impeaching President Trump.
Then, as calls to defund the police swirled around New York City and Black Lives Matter demonstrations filled the streets this summer, Mr. Rose joined a protest. That further alienated some moderate voters.
“The Republican promise was strong in terms of safety,” said Thomas Abbate, 46, a mechanical engineer from Bay Ridge, Brooklyn, who voted for Mr. Rose in 2018, but switched his vote this year to the Republican candidate, Nicole Malliotakis, because he said he feels his neighborhood is in decline. “We need a change.”
Buoyed by the prospects of broad anti-Trump fervor in New York City, Democrats had hoped to retain Mr. Rose’s seat, traditionally a Republican bulwark. Instead, he is on the verge of losing his race to Ms. Malliotakis. Republicans also seem poised to keep two House seats on Long Island that Democrats had hoped to flip, and could gain another seat in Central New York.
The Democratic Party, despite securing its majority in the House, lost seats instead of building its majority as expected. The party is now roiled in a debate over its future and its messaging, fueled by concerns that its stances had alienated moderate voters in competitive races. The passions spilled over in a conference call on Thursday between Speaker Nancy Pelosi and her caucus.
The party’s progressive stars, including Representative Alexandria Ocasio-Cortez, have forcefully challenged that narrative, suggesting Democrats faring poorly failed to get their message across through digital platforms, a critical oversight during a pandemic.
“I decided to open the hood on struggling campaigns of candidates who are blaming progressives for their problems,” she wrote on Twitter on Friday. “Almost all had awful execution on digital. DURING A PANDEMIC.”
While the suburbs in many parts of the country seemed to reject Mr. Trump’s brand of brash, hard-right rhetoric and policy, several Republican candidates in New York appeared to find success by characterizing moderate Democrats in swing districts as anti-law enforcement. That message was often conflated with calls from the left to “defund the police” and with occasionally violent clashes between authorities and Black Lives Matter protesters.
“The woke movement awakened the cultural conservative in a lot of voters,” said William F. B. O’Reilly, a Republican political consultant in New York. “The left overreached.”
Some Democratic leaders and political consultants have forcefully pushed back on characterizations that the party fell short in the 2020 elections, noting that they were behind in competitive districts that tend to favor Republicans in the first place.
In the State Senate, where several first-term Democratic incumbents are behind after machine counts of ballots, officials say there are tens of thousands of absentee ballots — which have broken heavily for Democrats in other states — yet to be counted, giving the party hope of limiting or completely eliminating losses.
Still, there was a grudging acknowledgment by Democratic leaders that their candidates had fallen short of expectations.
The state’s three-term Democratic governor, Andrew M. Cuomo, repeated on Friday that he felt the election results in New York “shouldn’t have been that close,” an outcome he attributed to Republican attacks on moderate Democrats and their usage of images of New York City during protests and scattered incidents of looting.
“In New York, I think the Republican message that they orchestrated, saying Democratic chaos must be stopped, Democrats are anti-law-and-order, I think that resonated,” the governor said.
The 11th Congressional District, represented by Mr. Rose, encompasses Staten Island and a part of South Brooklyn, and has long been the city’s most conservative. Guy Molinari and Susan Molinari, a Republican father and daughter political dynasty, represented the district in Congress for most of the 1980s and 1990s.
Mr. Rose was elected in a “blue wave” in 2018, beating the incumbent, Dan Donovan, by running as an anti-establishment centrist, saying he wanted to “get rid of all the leadership in D.C. — Republican and Democrat.”
But Ms. Malliotakis easily found success linking Mr. Rose, a veteran, to the Black Lives Matter movement and the progressive factions of his party, including the city’s unpopular mayor.
“She was able to paint Max Rose as less strong on law and order,” said Jim Lamond, 79, a resident of Bay Ridge who voted Democrat, but who has close friends who didn’t. “They thought Rose was too linked to de Blasio,” referring to Bill de Blasio, the New York City mayor.
Democrats also faced potential roadblocks on Long Island, once a Republican stronghold, but which has turned increasingly Democratic as suburban demographics rapidly change.
The party found success there in 2018, picking up four State Senate seats long held by Republicans. Democrats had hoped to build on that success, investing heavily to try to flip two congressional districts whose voters had traditionally elected Republicans.
The efforts seem poised to fail. On the eastern end of Long Island, the Republican incumbent since 2015, Representative Lee Zeldin, held a sizable lead over his Democratic challenger in the 1st Congressional District, with absentee votes yet to be counted.
The race in the 2nd District, which is represented by Peter King, a 14-term Republican who is retiring, appeared tighter, but Andrew Garbarino, a Republican Assemblyman, held an edge over the Democrat, Jackie Gordon, with absentee votes yet to be counted.
And Mr. Trump, who despite his unpopularity in many parts of New York, his former home state, seems on track to amass more votes in Nassau and Suffolk Counties than he did in 2016. His presence at the top of the ticket, some political observers said, may have benefited Mr. Garbarino in a district with many blue-collar voters.
“Trump in 2016, and this year, has been the largest driver of Republican voters in modern history,” said Matt Rey, a partner at Red Horse Strategies, a political consulting firm based in the city. “That includes bringing out a whole host of people who have never voted before, and beating his ability to do so in 2016.”
In several of New York’s swing districts, voters interviewed this week — many of them older and white — appeared receptive to Republicans’ law-and-order message and the perception that the Democratic Party was run by the far left and was singularly obsessed with defeating the president.
“I don’t see Democrats putting anything forward as a plan other than, ‘orange-man bad,’” said Vinny Papa, 54, who works as a parts manager at a car dealership in Suffolk County.
Mr. Papa, an independent voter who said he has voted for both Democrats and Republicans, said he is “not a big Trump supporter,” but voted for Mr. Trump because “Republicans are bad, and the Democrats are a hundred times worse.”
Dana Gencarelli, 35, a mother of two young children, said that she was happy with Ms. Malliotakis’s lead because her top concern was public safety, a priority she said Mr. Rose did not share.
“Do I always feel Republicans are doing the right thing? No,” she said, as she had pizza with family outside of Leo’s in Bay Ridge. “But right now the Democrats aren’t doing the right thing.”
Still others, including registered Republicans like Cameron Lory Faulds, a Bay Ridge resident who has voted for both parties in the past, chose the Democratic nominee, Joseph R. Biden Jr., because she wants someone “who represents my social views.”
“I’m not voting for Trump’s enablers,” she said standing by a yard sign outside her home that read: “I’m a Republican but not a fool! Biden 2020.”
In many cases, however, voters appeared jaded by an election cycle that devolved into one of the most bruising and divisive in recent memory. With the outcome of the election still uncertain, some voters preferred not to express their political views or say who they had voted for.
Walking in Lindenhurst, a village on Long Island’s South Shore, Richard S. Tibbets, 74, a retired union electrician and veteran, was one of those reticent voters.
“We don’t even know if our commander in chief is going to be the next president or not,” he said. “It doesn’t look good, but you never know.”
Mr. Tibbets would not say who he voted for, but his choice of headwear, if not his comments, seemed to provide the answer: He wore a Trump 2020 hat.
Reporting was contributed by Alexandra E. Petri, Arielle Dollinger, Angela Macropoulos and Sarah Maslin Nir.