Like the Electoral College itself, neither the Republican Party's nor the Democratic Party's nomination process was ever designed to reflect the popular will.
It may. But if so, then that is purely by coincidence.
What if Donald Trump were not nominated on the first round of voting at the Republican Convention, and someone who had never entered a primary were then drafted instead?
Or what if Trump were nominated, but that alternative's intervention landed the election itself in the House of Representatives?
In neither of those cases would the system have malfunctioned. In either of those cases, the system would have functioned, exactly as it was supposed to function.
Trump's reaction, and that of his supporters, would be the test of whether he and they were anything more than very big babies.