Our whole presidential nomination and election system is completely fucked. For instance, when you vote in a primary, you're not actually voting for a particular candidate, you're voting to send a delegate who's said they'll vote for that candidate to the convention. However, that delegate is not actually required to vote for that candidate, they can vote for whomever the fuck they want, and there's nothing anyone can do about it. It works the same way in the actual presidential election system too, in the electoral college the delegates can vote for whomever they want regardless of who they said they'd vote for that got them sent there (though it's very very rare that one changes their vote).
Another fucked up thing about the nominations (thank god this part doesn't apply to the actual election) is that there are so-called "superdelegates" who get to vote for who the nominee is going to be but aren't actually selected in the primaries, they just get it automatically because they're party leadership or hold other elected positions.