Yes, but the things you complained about were at the time significant to you. Complaining serves a purpose - it brings comfort, connection with others, help/support from others, and acts as a release valve.
If you had been walking round all the time thinking, "oh my god I might get leukaemia and my whole world might be turned on its head, I must be happy and grateful all the time" I don't actually think you would have been feeling any better! More like terribly unsafe and too petrified to enjoy anything.
You have a point to a degree - in the sense that it is useful for us to be a bit more aware in the present of the small good things, to notice those when we can and appreciate them, because that can make us feel more positive. But that doesn't mean we can't have feelings about the small bad things (or the bad things that are massive in the context of our life at the time!). You're not a robot!
Is beating yourself up for being a "bad person" helping you feel any better? Having work stress and complaining about things didn't give you leukaemia. You didn't bring this on yourself by being insufficiently grateful. Does blaming yourself make you feel more in control? If so, are there other things you could take some control of instead?
I imagine some of this is shock and grief for what you've lost and fear of what lies ahead. You're trying to feel safe again, and blaming yourself makes you feel a bit safer (if it's your fault, you have control and can protect yourself from anything worse). But it's also making you feel shit and miserable.
So being a bit kinder to yourself as you pass through this stage will probably make things feel more bearable. (When others are kind to us it eases our suffering and the same applies when we are kind to ourselves).
If you can't even have compassion (which as far as I can tell has the same meaning as "pity" just without the judgemental connotations we load it with) for yourself what hope is there.
What's happening to you is shit, you're allowed to have feelings about it. Just like you were allowed to have feelings about your work stresses.
It sounds like you're having good treatment. If feeling hopeful is too scary right now that's ok (feeling pessimistic can be a bit protective in tough times). Just please try to be nice to yourself instead of beating yourself up. You deserve kindness.