“There is a special place in hell for Clinton staff, allegedly including Cheryl Mills, that okayed the email server setup,” Jim Manley, a Democratic strategist and former senior aide to Senator Harry Reid of Nevada, wrote on Sidewire, a social media site, referring to a longtime aide and lawyer to Mrs. Clinton.

Mrs. Clinton’s campaign was so confident in her victory that her aides popped open Champagne on the campaign plane early Tuesday. But that conviction, aides would later learn, was based largely on erroneous data showing that young, black and Latino voters and suburban women who had been turned off by Mr. Trump’s comments but viewed Mrs. Clinton unfavorably would turn out for her in higher numbers than they ultimately did.

Exit polls conducted by Edison Research found that among people who said they had decided in the final week before Election Day, 47 percent voted for Mr. Trump and 42 percent for Mrs. Clinton.