That’s why parties choose electors who would commit political suicide if they went against the nominee.
Electors can be bought -—for potentially huge sums—and then leave the state.