While your math is correct, you’ve missed the larger picture.
Insurance on my house can be said to be a bad bet also. I own my house outright, so no one requires me to have insurance. Yet I do, because although the chances of serious damage are extremely low, the cost to repair or replace my home would ruin me financially.
I can afford to replace or repair every appliance I own, but not everyone can. For some people, an unexpected $500 expense is a disaster: they do not have the money and may not be able to borrow it or make payments if they can borrow.
That’s why they buy the warranty.