WASHINGTON — By cutting a bipartisan spending compromise among themselves, Republicans and Democrats in Congress not only prevented the White House from delivering on President Trump’s priorities in his very first budget, they also drafted a handy blueprint for circumventing the Trump administration in the future.

It was an outcome that should worry the new president even though Mr. Trump will be spared the humiliation of a government shutdown early in his tenure if he signs the legislation.

“We were sort of a united front, Republicans and Democrats, opposed to Trump,” said Senator Chuck Schumer of New York, the Democratic leader, in an interview.

Not exactly the words a president wants to hear in the opening months of his term — that the two usually warring parties on Capitol Hill instead joined forces to gang up on him. But that is essentially what happened.