@Katrina149 I imagine what happened is that you received a message saying the guest wants to cancel and asking you to approve that. This is a very sneaky thing Airbnb does that goes down as a host cancellation. Whenever you get one of those, you should decline it. The guest can cancel on their own.
It was nice that the guest was understanding. But in this case, you shouldn't have expected the guest to cancel- it was your issue, not theirs. And are you aware that the guest would not get the Airbnb fees they paid back? You really should have offered to re-imburse them for that.
The circumstances under which a host asks a guest to cancel are if the guest has indicated that they aren't going to follow your house rules, that they plan to bring children, when your listing says not suitable for children, intend to arrive with more guests than you accept, etc, or refuse to upload a profile photo, verifications, or anything else you state that you require in your listing info. But if you can't host for some reason, that's yours to deal with, not the guest.
You could have asked Airbnb to cancel this reservation under the extenuating circumstances policy, providing documentation of your medical procedure and you wouldn't have been penalized for the cancellation. Perhaps you can still do that.