My mother suffered from Alzheimer / dementia for 4 years. She was living with me during that time and I’d to take care of her. I couldn’t help it sometimes to wish that she’d finally die. It was very hard to work and take care of her at the same time. She passed away in 2008 and I suffered from horrible feelings of guilt for 2 years after that because I wished her death.
Later in 2011, my grandma who had practically raised me, started to suffer from Alzheimer /dementia. I had to take her to live with because there was nobody else to help and I also had to make some arrangement to work from home. This time I knew what to expect and I was so scared of reliving this horrible experience all over again. I was praying for her to die and sometimes I felt I really hated her. She passed in 2014 and since then I’ve been suffering from very deep feelings of guilt. I feel as if my prayers were the cause of her death. I sometimes dream of her and in the dream she refuses to talk to me. I feel that only when I’m dead she’ll be able to forgive me.
It is not uncommon for persons to wish for or pray for the death of a loved one who is suffering. It is very hard to see quality of life slipping away. This is not what we want for our mothers and grandmothers! And caring for elders, even elders we love dearly, is not what we expected in our lives and some resentment is natural. It doesn't mean we are monsters.
My husband had dementia. He was almost never in physical pain and he had a fairly decent quality of life, so I never wished that he would die. But he died anyway. My mother had dementia. She died without anyone ever wishing she would. Your mother and your grandmother would have died of their fatal disease whether you were in their lives or not. You are simply not powerful enough to cause their death by wishing.
Guilt is not an unusual reaction when someone close to us dies. It is probably more accurately called regret. But for it to go on so severely for years is very unhealthy. You don't deserve that.
You seem to have religious beliefs. Have you discussed this with a pastor, priest, rabbi, the head of your church?
Another option is to see a therapist. You can be completely open and honest in talking about your issues.