“Nancy just said she ‘just doesn’t understand why?’” Mr. Trump tweeted, paraphrasing her remarks about the administration not understanding economic hardship. “Very simply, without a Wall it all doesn’t work. Our Country has a chance to greatly reduce Crime, Human Trafficking, Gangs and Drugs. Should have been done for decades. We will not Cave!”

For Mr. Trump, the promise of repaying federal workers may be acknowledgment enough. As a book-writing businessman, Mr. Trump cited his disgust for a city worker on the job who “seemed to be on break,” and gained a reputation for treating workers on his construction projects poorly. As president, he has churned through advisers, especially those who have allowed any daylight to show between his public thoughts and theirs.

Mr. Trump’s allies have maintained that he cares about federal workers, but experts have not seen this in practice. Ken Jacobs, the chairman of the Center for Labor Research and Education at the University of California, Berkeley, said in an interview that the president’s response to the shutdown appeared to reinforce his pattern of treating workers as disposable.

What was “highly unusual,” Mr. Jacobs added, was that so many members of Mr. Trump’s cabinet and administration have appeared to share those views.

“When you have a cabinet filled with so many people who are as wealthy as this cabinet is,” Mr. Jacobs said, “it just seems like they just do not understand or can’t comprehend how your average person lives.”

Other members of the Trump administration have stumbled into unfortunate optics and delivered clumsy sound bites in recent weeks. Steven Mnuchin, the Treasury secretary, was in Cabo San Lucas when the shutdown began, and flew to Los Angeles this month on the private aircraft of Michael R. Milken, the billionaire “junk bond” king who pleaded guilty to securities fraud in 1990 and served two years in prison.

At a conference of America’s mayors on Thursday in Washington, he expressed his gratitude to federal employees who have been working without pay.