Airlines can also do this. They just have to refund your ticket, but good luck buying a replacement same day.
Airlines overbook and will try to get out of it by refunding your ticket. Refuse the refund. They'll up the price a few times. You can get up to an upgraded ticket on a later flight + hotel stay if the stars align.
That means if they boot you from the flight or hotel room, they have to pay for your costs to find a replacement.
Yes, many companies have terms that try to limit their liability, but those terms usually aren't enforceable.
https://europa.eu/youreurope/citizens/travel/passenger-right...
Also in my experience airlines will go out of there way to help and rebook. Sometimes it is the next day though which sucks but isn't totally apples to oranges ;)