I'm sorry to hear that, it's hard to lose one, especially when it looked like she was doing better.
Sometimes the ordeal they go through compromises internal organs, and even though they recover in some ways, that damaged organ finally gives out.
You gave her the best chance possible.