Republican leaders stand as President Trump arrives for a meeting in the East Room of the White House. (Jabin Botsford/The Washington Post)

Sen. Dean Heller was sitting two seats away from President Trump and facing his grim-faced colleagues this week when he decided to crack a pointed joke.

Heller — a square-jawed, ­sandy-haired moderate Republican — said the attack ads against him, paid for by a Trump-allied political group, should have used his own image instead of actor Matt Damon’s.

There were scattered laughs, including a chuckle from Trump. But many of the Republican lawmakers lining tables in the East Room stayed mute.

The senator from Nevada then reiterated that he had deep reservations about the party’s major rewrite of the nation’s health-care laws, despite the Trump network’s efforts to pressure him to back the legislation.

Trump nodded and said he under­stood Heller’s view. A ­couple of hours later, the group pulled the ads off the air.

(Jenny Starrs/The Washington Post)

Nearly everyone there Tuesday had a different take on the meeting, reflecting the Republican divide amid the struggle to fulfill a signature party promise.

White House officials and Trump loyalists saw a president diving in to patch up strife and save legislation that had been curbed in the Senate. Some seasoned senators, however, saw a president unable to grasp policy details or the obstacles ahead, and talked with each other after the gathering about what they saw as a bizarre scene. That Republican disconnect has been a constant ever since the Senate health bill was unveiled.

This account of the Senate measure’s shaky rollout is based on interviews with more than a dozen senators, aides and other well-connected Republicans, many of whom requested anonymity to offer candid perspective.

Senate Majority Leader Mitch McConnell (R-Ky.), who on Tuesday postponed a procedural vote on the health bill, continues to work with wary senators and the president’s team with the aim of moving an updated version to the Congressional Budget Office for scoring by the end of the week.

But the process so far has been messy and revealing of strains between Trump and the GOP Senate, as well as between McConnell and the senators he has long been known for managing with steely efficiency.

Instead of moving happily toward passage of the party’s rallying cry, Republicans are frozen and unsure of the political cost of passing the Senate bill — especially with swing voters who in many states have come to rely on aspects of Obamacare and its expansion of Medicaid.

“It’s sad, in a way,” Sen. Rand Paul (R-Ky.), a conservative critic of the bill, said in an interview Wednesday. “We control all three branches and yet we’re not interested or able to do what we’ve pledged. People are too focused on getting more federal subsidies and other things, not on the pledge itself.”

See where the Senate health-care bill’s subsidy cuts will affect Americans most

The GOP alarm on Capitol Hill over this week’s inaction was stoked further Tuesday when Trump told senators that he was eager for a vote but also hinted at the prospect of attempting to place the burden of problems with the current law on the Democrats in the coming months, should Republicans remain stalled.

“This will be great if we get it done. And if we don’t get it done, it’s just going to be something that we’re not going to like,” Trump told the room. “And that’s okay. I understand that very well.”

Trump’s aside prompted some senators to exchange concerned glances during the meeting, according to a person briefed on it. To a number of them, Trump’s remark had the same ring as his comment a week earlier about the House’s health bill being “mean.” His enthusiasm, to them, was debatable.

Heller is a case study of the GOP turmoil. Heller, who is expected to face a tough reelection fight next year, wounded the bill’s chances of passage last week with a highly critical statement that left little room for compromise. The move irked leadership and soon the Trump-allied political outfit swooped in.

By Saturday, it was evident that the aggressive response to Heller was not blessed by McConnell, who called the ad buy “stupid” in a phone call with White House Chief of Staff Reince Priebus, who has long ties to the former Trump advisers who lead the group, America First Policies.

“This has been way more difficult than it needs to be,” said Sen. Ron Johnson (R-Wis.), who has publicly opposed the bill from the right.

McConnell unveiled the 142-page bill last Thursday after crafting it in secret. It came under immediate attack from conservative and moderate Republican senators, and from much of the health-care establishment.

Sen. Ted Cruz (R-Tex.) joined forces with three other Republicans — Paul, Johnson, and Mike Lee of Utah — to issue a statement saying that although they could not support the bill as written, they were open to negotiating changes that could ultimately win their backing.

On the other end of the GOP spectrum, Sen. Susan Collins (Maine) said she also had “concerns about some of the provisions.” She opposed blocking federal funding for Planned Parenthood, as the Senate bill would do, and said she was unsettled by changes to Medicaid that would result in long-term federal spending cuts to the program, echoing Heller’s objections.

Conversations among McConnell’s staffers concentrated on Cruz and others who said they were open to voting for it if changes were made. Things could have been far worse, one McConnell confidant reasoned. If it was a rebellion, it seemed small in scale.

But the bill’s curtailing of Medicaid spending — including a $772 billion cut over the next decade — caused a lingering sense of heartburn for center-right Republicans.

Even before Senate GOP leaders debuted the bill, Republican governors from Medicaid expansion states had been issuing warnings. While some of these governors hailed from swing states, such as Ohio and Nevada, conservatives such as Arizona’s Doug Ducey (R) said that the proposed changes could prove too damaging for their states to handle.

McConnell’s advisers turned to the White House on Friday to assist with the cause but did not ask for a full-fledged push. Unlike when the House bill tottered and House Speaker Paul D. Ryan (R-Wis.) called on Trump to rally members, McConnell wanted to keep the negotiations inside the Senate.

“In the early stages, candidly, it’s been kind of a waste of his time,” McConnell told reporters Tuesday, explaining Trump’s more hands-off approach in the health-care discussions. “We needed to get this far enough down the path.”

Trump, who spoke with Cruz on Thursday, stayed in touch with the Texan, and aides planned calls by Trump to Paul and Lee. Paul, in particular, was seen as someone Trump could entice; they have a rapport from past rounds of golf, and Paul represents a state that went heavily for Trump. A meeting was eventually arranged for Tuesday at the White House.

Vice President Pence, meanwhile, also set meetings and made calls.

But Trump and his team ran into internal Senate GOP dramas that had little do with them, such as friction between McConnell and Johnson, who told reporters this week that he had never been contacted by the majority leader.

Senate GOP aides still worked through the weekend in hopes of teeing up a vote this week. But Heller’s discomfort and the subsequent threat from the Trump-aligned organization weighed on Republican minds. When McConnell associates and Trump’s legislative staffers reached out, conversations inevitably drifted to Heller and the confusion many senators felt about the White House’s role.

“My phone was blowing up!” one former Republican official said of the Heller fallout.

In Colorado, as hundreds of donors met for a three-day seminar organized by billionaire industrialist Charles Koch, leaders from the constellation of organizations that support his agenda also outlined concerns.

“In all candor, we’ve been disappointed that movement is not more dramatic toward a full repeal or rollback,” said Tim Phillips, president of Americans for Prosperity. “We still think this can get done, but the Senate bill needs to get better.”

As Senate leaders feared, the bill’s fate took a turn for the worse Monday, when the CBO released an analysis concluding that the Senate bill would cause an estimated 22 million more Americans to be uninsured in the coming decade — just 1 million fewer than similar legislation passed by the House in early May.

A lobbyist close to Senate Republicans said the score was a devastating blow to McConnell. Senators felt they had been “sold a bill of goods,” the lobbyist said, and had expected the Senate bill to have greater distance from the House bill.

“It knocked the wind out of all the sails,” said a GOP aide.

Senators began to shift into two camps: those who wanted to attack the CBO’s methodology, and those who realized it would not matter once people back in their states heard the numbers.

Angst was apparent Monday afternoon and evening. In the hallway between McConnell’s office suite and the Senate chamber, reporters questioned grumbling Republican senators about what they planned to do next.

Sen. John Cornyn (Tex.), the chamber’s No. 2-ranking Republican, preemptively faulted Democrats for refusing to cooperate.

Around the corner, Cruz refused to directly answer a question about whether he would even vote to bring the bill to the floor and simply repeated his oft-stated goal of lowering premiums as the door to the elevator he was riding slowly closed.

“There were so many moving parts,” Paul said this week. “It’s not that it was impossible, but there wasn’t enough time.”

By Tuesday morning, Republicans were eager to avoid the topic as they headed to their usual Senate lunch, running from reporters who swarmed the elevators shouting questions.

McConnell’s final announcement of retreat at the Tuesday lunch was typically understated. He led off by saying that plans for a vote would be shelved until after the July 4 holiday but that deliberations would continue — and that the president would like to see everyone later that day.

Then it was time to vent. Some members ticked off their concerns about the CBO when four representatives from the nonpartisan agency joined the lunch. But, mostly, senators were caught off guard — rattled by the delay and by the knotty policy disagreements.

McConnell had led them to expect a vote this week, amid all the waffling. They had found it hard in recent days to determine the scope of the objections and sensed that Republican leaders, somehow, would announce a package of fixes that could get skeptics on board.

When asked when he realized the vote was off, Sen. Bill Cassidy (R-La.) said, “Not until the leaders said we weren’t going to vote this week.”

The signs had been there, though, all along. So had the discontent about the entire endeavor: Heller and the advertising barrage, the wrangling over Medicaid, the conservative outcry and the CBO. All of those issues hovered as Heller awkwardly tried to break the ice with Trump at the White House.

Heller knew the vote was off, but he was irritated by how he was targeted and contended that he was only doing what some other senators were doing: listening to GOP governors who did not want to disrupt their states’ Medicaid funding.

One person close to Heller described his thinking as “doing what’s best for his state and Heller,” since he believed he could not count on Trump or the GOP to save his seat. Like most Republicans, he had long been for ACA repeal, but the mounting complications that came with passing the bill were just too much.

“Actually, let’s face it,” Cassidy said Tuesday. “When you saw four people publicly coming out and saying they wouldn’t vote for the motion to proceed — and you knew there were others that had concerns that weren’t voicing them — you knew it probably won’t happen.”

And so it didn’t, at least for now.

James Hohmann and Ashley Parker contributed to this report.