Can a rare earth magnet hurt my iPhone?

Episode 1720
Steven fromSteven has an iPhone 11 with a waterproof case. He got a magnet and a piece of metal to mount it to his car dash. But it doesn't' stick. Will a rare earth magnet help? Leo says they are much stronger than a regular magnet. It won't hurt your phone, but it could throw off your phone's internal compass.