The enactment on Wednesday of the Justice Against Sponsors of Terrorism Act should have been a triumphant moment for Republican leaders in Congress. They had succeeded, after years of trying, in overriding a presidential veto for the first time and forcing a bill into law over the strenuous objections of Barack Obama.

But the morning after brought no such celebration for House Speaker Paul Ryan and Senate Majority Leader McConnellonly pangs of regret.

“It appears as if there may be some unintended ramifications,” McConnell lamented at a press conference barely 24 hours after all but one senator voted to reject the president’s veto of the legislation, which would allow victims of the September 11, 2001 terrorist attacks to sue Saudi Arabia in U.S. court. On the other side of the Capitol, Ryan said that he hoped there could be a “fix” to the very law he allowed to pass through the House—one that would protect U.S. soldiers abroad from legal retribution that the Obama administration had warned for months would follow as a result of the law.

A White House spokesman soon derided the Republicans’ “buyer’s remorse,” and indeed, the scenario was hard to fathom: How could a Congress plagued by gridlock pass legislation with overwhelming bipartisan majorities, initiate a rare veto override, and then immediately voice regret about the problems the new law might cause?

The answer is a mix of sensitive 9/11 politics, an unusually powerful bipartisan alliance, election-year timing, and a heavy dose of mistrust and miscommunication between two branches of government that rarely see eye to eye.

The bill itself is not new. For years, victims of the 9/11 attacks and their families have pushed for a change in the law that would exempt acts of terrorism on U.S. soil from the principle of sovereign immunity, which prevents lawsuits against foreign governments and officials in American court. The families want to sue the Saudi government for damages over its alleged ties to the 9/11 hijackers, 15 of whom were Saudi citizens. The Saudis have denied any involvement, and as CIA Director John Brennan made clear on Wednesday, the U.S. government has backed up their denial.

The 9/11 families had two influential senators in their corner: Charles Schumer of New York, likely the next Democratic leader, and John Cornyn of Texas, the second-ranking Republican. With their backing, a revised version of the bill cleared the Judiciary Committee in the spring and then passed the full Senate on a voice vote—a rarity for legislation that drew such vociferous opposition from the White House. Any senator could have objected, but then as now, none wanted to go on record against a proposal billed as “justice for 9/11 families.” Yet because the legislation first passed the Senate without debate, many members only became aware of the administration’s concerns in the last several weeks after Congress returned from a long summer recess. The House passed the bill in similar fashion—without much debate—two weeks ago, and Obama returned it with a veto message last Friday.

“This is a bill that should have been given a greater airing,” Senator Ben Cardin of Maryland told me on Thursday. “It was not on my radar screen until after the train was leaving the station. The next thing I know, it’s on the president’s desk.” Cardin is no backbencher; he is the top Democrat on the Foreign Relations Committee and along with the panel’s chairman, Bob Corker of Tennessee, he spent the last several days scrambling to work out a compromise with the Obama administration that would have kept the bill, as written, from becoming law. Time ran out this week, however, as McConnell decided to bring up the veto-override vote just before lawmakers left to campaign for reelection.

Technically, McConnell could have waited until the lame-duck session in November, allowing more time for debate and the possibility of a compromise. Cardin said, however, that it is Senate custom to act on presidential vetoes as soon as they are received. A Senate Democratic aide, speaking on the condition of anonymity, surmised that the timing had more to do with politics and a pent-up frustration with the outgoing Obama.

Either way, neither Democrats nor Republicans objected to the vote, and the 97-1 tally was an overwhelming rebuke of the White House. Only Harry Reid, the retiring Democratic leader, supported the president’s veto. Vice-presidential nominee Tim Kaine wasn’t in town to vote, but following the lead of Hillary Clinton, he said he would have gone against Obama and overturned the veto. Hours later, the House voted 348-77 to make the bill a law.

The White House was apoplectic. Josh Earnest, the press secretary, told reporters on Air Force One that the veto was “the single most embarrassing thing the Senate has done” since 1983—an apparent reference to a long-since-forgotten veto override in which Congress intervened in a federal land dispute. He went even further on Thursday, mocking lawmakers for claiming ignorance of what they were voting on and accusing them of ignoring warnings from the intelligence community, the chairman of the joint chiefs of staff, and even the head of General Electric that the bill could put U.S. soldiers, personnel, and broader economic and diplomatic interests overseas in jeopardy. “What’s true in elementary school is true in the U.S. Congress: Ignorance is not an excuse,” Earnest said.

Appearing at a CNN veterans forum Wednesday night, Obama called the override “a mistake” motivated by lawmakers’ understandable concerns about emotional 9/11 politics and the looming election. He reiterated the objections he outlined in his three-page veto message—that by overturning sovereign immunity even for terrorist attacks on U.S. soil, Congress could be exposing U.S. personnel to lawsuits and other legal action all across the globe. Under current law, the U.S. government can exempt a country from sovereign immunity by having the State Department designate it as a state sponsor of terrorism (which it has not done for Saudi Arabia). “This is taking that out of our military and our intelligence and the hands of our national-security professionals and putting it into the courts,” Obama said. “And that’s a mistake.”

In floor statements before the override vote, senators were clearly torn between the two arguments—the desire to let 9/11 families “have their day in court” versus the worry that doing so would put U.S. forces at risk abroad. “I came to the conclusion that there are risks both ways,” Cardin said. He and Corker, along with others, had tried to persuade Schumer and Cornyn to narrow the bill so that it only applied to the 9/11 attacks and Saudi Arabia, but they were rebuffed. Shortly before the veto override, nearly one-fifth of the Senate released a letter to Schumer and Cornyn voicing their concerns and the hope that they could work together “in a constructive manner to appropriately mitigate those unintended consequences.” They all voted for it anyway.

The angry response from Earnest took both Republicans and Democrats aback. It was the kind of broadside the White House generally reserves for partisan warfare or a government shutdown, not a bill supported by 97 out of 100 senators and most of the Democratic leadership. Privately, Democrats wondered whether the White House was inflating its outrage as a signal to Saudi Arabia and U.S. allies who had lobbied hard against the bill.

For their part, Republicans blamed the White House for waiting too long to warn lawmakers about the bill’s “potential consequences,” as McConnell put it. “That was, it seems to me, an example of a failure to communicate on a piece of legislation that was obviously very popular,” the majority leader told reporters. At a committee hearing, Corker said that as recently as this past weekend, Secretary of State John Kerry couldn’t convince the White House to engage in negotiations for a compromise. “Secretary Kerry couldn’t even get the White House to call me,” he said. “The outburst yesterday from the White House over what happened is remarkable when they wouldn’t even sit down to meet with the secretary of state and us.” Earnest denied the charges and said “there were extensive negotiations and extensive consultations” on the bill.

Still, even Democrats were skeptical that the administration would have supported even a narrower proposal, given its highly sensitive relationship with the Saudi leadership. “It probably wouldn’t have satisfied the White House, but the heartburn wouldn’t have been as intense,” the Senate aide said.

Can Congress fix a law when the ink has barely dried? Maybe, but both sides are skeptical that any changes are coming soon. The more likely scenario is that lawmakers will wait to see what repercussions transpire and then try to react. “After the election passes,” Earnest mused, “perhaps we will see more principle on display in the U.S. Congress.”