Of course you're not a bad Mum, you sound like you really love your daughter!
I also have a long term health condition and have tried in previous years to cover up how bad I'm feeling, so as not to scare our DDs, who are 11 and 13. Earlier this year, I contracted SEPSIS, staff pneumonia and a staff infection in my PICC line and was hospitalised. I remember calling my GP and saying I needed to be admitted, then nothing for just over a week.
When I woke, I was in ITU, having been unconscious and the Drs had told my DH that I wasn't likely to make it, so he had to make the decision to let our daughters come in and see me, knowing it might be their final chance. He didn't tell them to "say goodbye" or anything, but this visit had a profound effect on them, as you can imagine.
When I was eventually released from hospital, both girls were suffering from separation anxiety and it's taken months to help them feel 'safe' in the knowledge that Mummy is home and well(ish). Our younger DD always rounds off saying goodnight to me now with "Stay safe and DON'T die!"
I felt like a terrible Mother, for a really, really long time. I couldn't believe what I'd put these two little people through, but over time I have come to understand and accept that I did NOT ask for this poor health (and nor did you, OP) and that the only thing I can do to make it up to them is to keep on top of my meds and appointments, report any new symptoms to my medical team asap and get myself admitted to hospital quickly whenever I realise that's what's needed.
The memories from earlier this year have faded somewhat for my 2 and they will for your DD too, especially at her age. Just focus on taking really good care of yourself and on loving her and you won't go far wrong!