As he inched closer to reluctantly accepting a bipartisan spending compromise without the money he demanded for his border wall, Mr. Trump offered no acknowledgment on Wednesday that his pressure tactics had failed even as aides sought to minimize the damage by tamping down criticism on the right.

One call was made to Lou Dobbs, a favorite of Mr. Trump’s whose Fox Business Network show he often tries to catch live. Another was placed to Sean Hannity, the Fox host who regularly talks with the president. The message: Mr. Trump deserved support because he still forced concessions that he would never have gotten without a five-week partial government shutdown.

Even so, it was arguably the most punishing defeat Mr. Trump has experienced as president, and it left the White House scrounging for other ways to pay for a wall on the southwestern border and rethinking its approach to a Congress now partly controlled by Democrats. Mr. Trump’s inability to reach a satisfying deal despite the negotiating experience he regularly touted on the campaign trail suggested that any aspirations of collaboration across party lines may be even more elusive than he had imagined.