Like look at hispanic trump voters.
Democrats lost Hispanic voters by running to the right on immigration and giving up on any sort of rhetoric about how "building the wall" is racist. The anti-immigrant people still voted Republican, while conservative Hispanics no longer saw a reason to look past culture war issues based on immigration, since there wasn't that much difference between what the two parties were saying.
People love to go all "leopards ate their face" and just attribute it to stupidity but it's really a failure on the part of the Democratic party's messaging and tactics. They caved to the right's rhetoric and it backfired, just like it always does.