Polling gets it wrong when ...
... the voting machines vote against a candidate. A significant proportion of voting in the US is by electronic touch screen - you make your selections and then press "vote" - and the machine records your choices ... well actually I don't know what it does, I just hope it records them.
Essentially we have to trust the company that makes the machine and the people who program it for each election - and then the people and methods used to transfer each machines vote counts to the server so that they can be totals at the end of the day.
What's been interesting in the last few election cycles is that they appears to be a small difference in the precincts that vote electronically and the precincts that vote on paper. Precincts with electronic voting appear to show a slight preference for Republicans - give that the electoral balance between Democrats and Republicans is pretty much 50/50 nationally, if you could shift two percent of the votes from one candidate to another then you could win the election.
Is this happening? I don't know but the statistics is interesting and it's fun watching the pundits trying to explaining the difference between exit polls and the actual votes - this usually comes done to, "Republican voters are embarrassed to admit that they voted for Trump" - LOL, like I believe that!