We have had the same concern as OP, even though we have never had to cancel a trip (though we have traveled sick). We did some research into trip insurance before our last trip, as we were going to rent an AirBnB, but chickened out and stuck with a hotel.
As Dacky619 mentioned, the only way to know for sure on the coverage is to read the terms and conditions of the trip insurance policy. Most policies seem to cover you if you can't go, but their definition of "can't go" may be different than yours (i.e. if you're sick but not immobile or documented as bed-ridden, you're expected to go). I would always assume that coverage applies only to invoiced expenses and not any unofficial side agreements for which you may be or feel obligated to pay.
If you're using a credit card, many rewards cards offer travel insurance as a perk, and will cover trip expenses charged to the card. These policies are usually underwritten by outside companies, so they are just as legit as standalone trip insurance, but again the T&Cs matter. Those T&Cs are usually found in the credit card agreement, or in a rider to it. It's worth checking before you pay for a standalone policy.