Senate Majority Leader Mitch McConnell (R-Ky.) speaks at the Capitol on July 18, 2017. (Carolyn Kaster/AP)

In early May, when Senate Republicans began working on health-care legislation, they quickly turned away from two spectacles: the unpopular House bill and the president of the United States’ premature White House Rose Garden celebration of its passage.

Instead, Senate Majority Leader Mitch McConnell (R-Ky.) decided to work up a different bill inside his Capitol office — and left Trump on the sidelines, where he happily stayed.

It might have seemed the right move back then, pushing away an unpopular president whose thin grasp of health policy left the more cerebral senators seeking out other counsel for far-reaching legislation.

Behind closed doors, the thinking went, GOP senators would reach the consensus needed to repeal the dreaded Affordable Care Act without the din of Trump’s tweetstorms getting in the way.

“Let us work through the process and allow it to work its way through the system, and then you can come in at the end and close it,” Sen. Marco Rubio (R-Fla.) told reporters Tuesday, recounting the strategy that senators came up with for Trump. “That’s the advice he took.”

This week, however, brought a painful reminder for Republicans of how difficult major legislative undertakings can be with a president who is doing other things, picking fights with TV news hosts and devoting an inordinate amount of time to a mounting scandal about his 2016 presidential campaign.

“The flip side is it’s very difficult to do big things without the involvement of the president. So it’s kind of a Catch-22,” Rubio said. The onetime primary challenger to Trump said that many Republicans knew exactly where the president stood and chose not to stand with him.

“The bottom line is there are members here who understood the president’s preference and were willing to vote against it anyway,” Rubio told The Washington Post’s Ed O’Keefe.

While Trump stood on the sidelines — he was literally there over the weekend, in the gallery watching the Women’s U.S. Open at his New Jersey golf course — his top advisers tried to help. On policy details, the administration used Seema Verma, administrator of the Centers for Medicare and Medicaid Services, and Health and Human Services Secretary Tom Price.

And Vice President Pence served as an intermediary, shuttling back and forth to the Senate to talk with some key Republicans.

Yet Trump’s top advisers sometimes hurt the president’s cause, particularly last weekend at the summer meeting of National Governors Association. They failed to convince Nevada Gov. Brian Sandoval (R) that the proposal to shrink Medicaid’s long-term growth would not hurt his state, which accepted the Affordable Care Act’s expansion of Medicaid to provide insurance to the working poor. In addition, Pence used faulty statistics to attack Ohio Gov. John Kasich (R), who also accepted the ACA’s Medicaid expansion.

Those two governors have key Senate allies, Dean Heller (R-Nev.) and Rob Portman (R-Ohio), who for weeks now have resisted McConnell’s push on the health-care bill.

Overall, the effort to shore up support for the proposal really lacked a central salesman.

Trump, aside from an occasional tweet that was light on substance, stuck to other topics. McConnell, notoriously opaque, delivered daily floor speeches that were carried on C-SPAN 2, but that was about it. No committee chairman took ownership, in part because McConnell ran the effort from his office and not through legislative committees.

In the House, Ryan became the leading spokesman for the plan in twice-weekly news conferences and near-daily appearances on national cable TV and radio shows.

Trump’s absence went against what Pence had promised lawmakers back in late January, at an issues retreat in Philadelphia, when he compared the planned approach to how Ronald Reagan sold his tax-cut plans in 1981.

“We’re going to be taking the message straight to the American people,” Pence said, according to a secret recording made by a liberal activist who sneaked into the closed-door session.

In 2009, President Barack Obama did just that, barnstorming the country with speeches detailing the policy prescriptions in the ACA. Obama delivered an address to a joint session of Congress in September 2009 on just one issue, health-care, and he held regular sessions with wavering Democrats for weeks and weeks.

In 2001, President George W. Bush faced stiff resistance from his own party on his signature domestic policy agenda item, the No Child Left Behind education bill. A former Texas governor steeped in education, Bush worked with the late Sen. Edward M. Kennedy (D-Mass.) and then-Rep. John A. Boehner (R-Ohio), a committee chairman at the time, to roll the conservative opposition and bend Congress to his will.

Yet Obama and Bush made those moves from positions of strength, each with an approval rating of 59 percent at this stage of his first year in office, according to Washington Post-ABC News polling.

Trump has an approval rating of just 36 percent.

So, as the legislation began to unravel over the past three weeks, McConnell lacked the power to bring discipline to a caucus that increasingly had groups of senators pushing in their own directions.

Republicans from Medicaid-expansion states feared the backlash from a proposal that would leave 22 million people uninsured.

Conservatives balked at the McConnell draft for leaving large portions of existing law in place, including some tax increases on the wealthy.

Others used the debate to push for more far-reaching entitlement policy changes that had not even been in the original House draft, which Trump eventually said was a “mean” bill.

No one could pull the group together, leading to failure.

“This is the Senate. Leadership sets the agenda, but senators vote in the interests of their states,” Rubio said. “Republics are certainly interesting systems of government, but certainly better than dictatorship.”

Read more from Paul Kane’s archive, follow him on Twitter or subscribe to his updates on Facebook.