Not a good example in there. My grandmother almost voted dead though, right after she sent in her absentee ballot she got really sick, was in the hospital during the election. It can happen legitimately, but it's probably pretty rare.
It wouldn't have mattered if your grandma had died after voting.
She cast a legitimate ballot. It's would be no difference if she had been hit by a car leaving the polls.
The vote would still be legitimate.
Your post sounds like she got better. I hope so.