The result, according to interviews with more than two dozen current and former administration officials and others in contact with the White House, was a lose-lose situation. Mr. Trump not only ended up soundly defeated by Joseph R. Biden Jr., but missed his chance to show that he could rise to the moment in the final chapter of his presidency and meet the defining challenge of his tenure.

Efforts by his aides to persuade him to promote mask wearing, among the simplest and most effective ways to curb the spread of the disease, were derailed by his conviction that his political base would rebel against anything that would smack of limiting their personal freedom. Even his own campaign’s polling data to the contrary could not sway him.

His explicit demand for a vaccine by Election Day — a push that came to a head in a contentious Oval Office meeting with top health aides in late September — became a misguided substitute for warning the nation that failure to adhere to social distancing and other mitigation efforts would contribute to a slow-rolling disaster this winter.

His concern? That the man he called “Sleepy Joe” Biden, who was leading him in the polls, would get credit for a vaccine, not him.