The fury among Senate Republicans toward Mr. Trump has been building since last month, even before he lashed out at Mr. McConnell. Some of them blame the president for not being able to rally the party around any version of legislation to repeal the Affordable Care Act, accusing him of not knowing even the basics about the policy. Senate Republicans also say strong-arm tactics from the White House backfired, making it harder to cobble together votes and have left bad feelings in the caucus.

When Mr. Trump addressed a Boy Scouts jamboree last month in West Virginia, White House aides told Senator Shelley Moore Capito, a Republican from the state whose support was in doubt, that she could only accompany him on Air Force One if she committed to voting for the health care bill. She declined the invitation, noting that she could not commit to voting for a measure she had not seen, according to a Republican briefed on the conversation.

Senator Lisa Murkowski of Alaska told colleagues that when Mr. Trump’s interior secretary threatened to pull back federal funding for her state, she felt boxed in and unable to vote for the health care bill.

In a show of solidarity, albeit one planned well before Mr. Trump took aim at Mr. Flake, Mr. McConnell will host a $1,000-per-person dinner on Friday in Kentucky for the Arizona senator, as well as for Senator Dean Heller of Nevada, who is also facing a Trump-inspired primary race next year, and Senator Deb Fischer of Nebraska. Mr. Flake is expected to attend the event.

Former Senator Judd Gregg of New Hampshire, a Republican who is close to Mr. McConnell, said frustration with Mr. Trump was boiling over in the chamber. Mr. Gregg blamed the president for undermining congressional leaders, and said the House and Senate would have to govern on their own if Mr. Trump “can’t participate constructively.”