Getting the wrong demographics adjustments
Brexit, Trump and this election polls got it wrong because they did not perform the demographics adjustment correctly.
BrExit got the pensioners voting in droves. I will always remember a cute pair on that day. She, in a wheelchair, draped in a Union Jack blanket. He, pushing the chair and sucking on a Union Jack sticker-ed oxygen bottle in the pushchair tray. The Romanian nurse changing their nappies, the German surgeon who replaced their hips and the polish delivery driver bringing the new oxygen bottles on a weekly basis "took their jobs". The polls failed to predict the lack of engagement with the younger generation (courtesy of the fat cat club that ran Remain) and the droves of angry pensioners going to the polls.
Trump win was predicted by a couple of sociologists, but was not publicized at all prior to the vote. They quite correctly noted that the only 19% of the white males in the mid-west and rural regions elsewhere vote and it will take Trump only pushing that to ~40% to win by a landslide. No poll performed this adjustment so rather unsurprisingly the results came up as a shock.
This election was won by the younger generation. It traditionally swings left and it was most spectacular in university cities. The usual university city battles are between Tories and Liberal Democrats with engagement standing at sub <60%. Instead of that we had >75% (going into 80%+ in places) and Tory vs Labor. Students voted. They have not seen how a country run by a proper left government looks like as they were born after that (Blair's "left" is somewhere around Atilla The Hun so it does not count). It now depends if Labor manages to keep that engagement (not particularly difficult at the current tuition rates and easy to counter by rolling them back).
In all cases the demographic adjustment and the failure to correctly account for changes in voter engagement for specific demographics was that turned the cart.