The electoral map was stacked against him, he argued, making Democrats underdogs from the start. And his own party kept him off the trail, meaning he never really got the chance to make his case. “You’re in the Final Four,” as one aide put it, “and you’re on the bench with a walking boot and you don’t get to play.”

The midterm elections culminated a season of discontent for the president — and may yet open a period of even deeper frustration. Sagging in the polls and unwelcome in most competitive races across the country, Mr. Obama bristled as the last campaign that would influence his presidency played out while he sat largely on the sidelines. He privately complained that it should not be a judgment on him. “He doesn’t feel repudiated,” the aide said Tuesday night.