Even before President Donald Trump rolled another grenade into an immigration fight on Capitol Hill, Republicans knew that their two proposals were destined to fail.

The party didn’t need bombastic tweets from the commander-in-chief in order to descend into factionalism. On Wednesday afternoon, the leader of the House’s most conservative bloc could be spotted shouting at House Speaker Paul Ryan (R-WI) on the floor of the chamber. The GOP’s more moderate members were also on edge.

By Thursday, all hell had broken loose—or at least some congressional version of it. Lawmakers failed to advance the more conservative immigration measure it was considering, and pushed the pause button on another more moderate version just hours after the president essentially told them that their efforts were futile.

“What is the purpose of the House doing good immigration bills when you need 9 votes by Democrats in the Senate, and the Dems are only looking to Obstruct (which they feel is good for them in the Mid-Terms),” Trump tweeted. “Republicans must get rid of the stupid Filibuster Rule-it is killing you!”

The legislative paralysis was not, in and of itself, surprising. Neither chamber of Congress has been able to pass large-scale immigration reform during the Trump presidency. But the back and forth over the last few days brought to the surface some of the simmering tensions that exist between the White House and Republicans on Capitol Hill, where some members are growing more openly exasperated with Trump’s unpredictability and his peccadilloes.

“He undermined it. There are a number of people on the fence that are looking for him to lean in and say, ‘please support this bill.’ And instead he questioned, strategically, why we should even put the bill on the floor,” Rep. Ryan Costello (R-PA), a moderate who is not seeking re-election, said in an interview. “And for members that were squeamish on that bill, that’s not a reason to vote for it. That’s a reason to vote against it.”

Trump’s rhetoric, whether intentional or not, had an impact. The more conservative of the two bills failed by a vote of 193 to 231. A vote on the second bill—the compromise authored by House GOP leaders that was intended to placate conservatives and moderates—was pushed to next week so that it could be amended to the conservative bloc’s liking.

The damage done on Thursday was not just legislative. It was personal, too. Virtually all sides of the Republican conference expressed wariness with Trump’s approach on the policy and toward lawmakers in general. Even Trump’s own supporters admitted that the situation was suboptimal.

“I spent some time on the Hill today and yesterday and members are very frustrated,” said Jack Kingston, a Trump surrogate and former GOP congressman. “I think they will get there. But right now they are kind of ticked off.”

Kingston said that much of the frustration was owed to an absence of communication between the White House and lawmakers over the president’s controversial family seperation policy  that has since been dialed back throgh an executive order,

On Tuesday, Trump met with Republicans in an effort to encourage them to pass at least one of the two immigration bills that would have addressed the policy. But according to lawmakers who were in the room the president mostly talked up his accomplishments instead of focusing on immigration.

During that meeting he also taunted Rep. Mark Sanford (R-S.C.),  after Trump wrote on Twitter that voters should reject him because he is an outspoken critic of the president. The jab drew groans and boos from the GOP conference, according to people in the room. But on Wednesday, Trump was insisting  that Republicans “applauded and laughed loudly when I mentioned my experience with Mark Sanford.”

Rep. Raul Labrador (R-ID), a member of the conservative House Freedom Caucus, said Trump had mischaracterized the exchange and, perhaps more importantly, undermined the overall immigration effort.

“There was absolutely no applause, and I think it’s unfortunate that that incident happened,” Labrador said. “The president needs to understand that that may have actually lost him votes during that meeting. Because the reason he was there was to emphasize that he had our backs. And I think a different message was sent.”

Sanford, for his part, agreed.

“Our actions and our words have consequences. And if somebody goes before a body and says things that aren’t true, one could argue it causes that body to trust the person speaking just a little bit less than they otherwise might have,” Sanford told The Daily Beast.

Inside the administration, there is little worry about frayed relations. One senior White House aide suggested that both Labrador and Sanford were smarting in part from the fact that each never won the president’s electoral support in their respective races—the former for the Idaho gubernatorial race, the latter for re-election to his House seat. The aide noted that requests for Trump and his aides and family members to stump on the trail for lawmakers remain robust.

That sentiment was echoed by one of the party’s top lobbyists who said that the prevailing sentiment among lawmakers was to keep the peace before the midterms.

"Most of these guys are clocking the time clock and doing what they have to do to get elected,” the GOP lobbyist said. "They are professional politicians! it is like any other place that has employees. Most of the people aren't looking to get fired or create a shit storm around them so that they do get fired."

But maintaining a peaceful status quo is far different than producing a legislatively productive one. And while GOP lawmakers may still largely show fidelity to Trump, they also seem confused by his strategy.

The president’s missives this week—both on Twitter and in his closed-door meeting with House Republicans—came precisely at the moment that GOP leadership was leaning on the White House to help secure votes on its bills. According to two senior Republican aides, the GOP vote-counting operation had concluded that it did not need to target lawmakers who were on the fence because leaders were relying on the president and other administration officials to convince the holdouts to support the compromise bill. In addition to Trump, Homeland Security Secretary Kirstjen Nielsen met with lawmakers this week.

Publicly, Ryan said he was not concerned with Trump’s early-morning tweet about the poor prospects in the Senate, saying that the complaints about the House bill were born from legitimate frustration about the procedures of the Senate. Others in the party insisted that Trump had essentially doomed them to failure.

“[His strategy] is not as cohesive and linear as it should be if he wanted to effectively have Congress move forward in enacting an agenda. Because the legislative process at times can be haphazard and unpredictable, the more aligned you are and the more clear you are, the easier it is to manage that,” Costello said. “And I feel, a lot of people feel, it’s more disjointed than it should be as a consequence of that lack of clarity and tweets like that.”