You asked: Christians: if you prayed for a terminally ill person but they died would this prove that prayer doesn’t work?
No, it doesn't.
Do you understand that God will not go against a persons will? Not even in dying. God is the Healer and He always wants a person healed. However, some people do not want to be healed, some do not believe and won't receive healing; some refuse to do what they need to do to receive healing; and some have given up because they are tired of fighting the battle to stay alive. Sometimes our faith isn't there when we pray, we are doubting that healing will come and so it doesn't, because God honors faith. God is never at fault. He always answers, we just don't always receive it.
When you see a person who is bent over from scoliosis with their spin twisted, immediately stand straight up and their spine completely straightened right before your eyes when someone has just prayed for them, you don't question whether prayer works.
A person with stage 4 lung cancer has been given only a few months to live because there is nothing more that can be done for him medically. He returns to the Oncologist after being prayed for and tells his doctor the cancer has left his body. When tests are run and confirm that there is no cancer left in his body, not even the doctor questions who was responsible for it.
Two weeks ago my baby brother had an 8.5 hour surgery on the vertebrae in his neck. When my husband and I arrived he was crying and in agony. They had already given him as much morphine and other pain medication as they could but it wasn't enough. We laid hands on him and prayed for him and the pain stopped immediately. He's been through 14 surgeries and is no stranger to pain. Yet, this incident left such an impression on him that he shared it with our mother several days later.
These are just a few of the many things we have witnessed in answer to prayer recently. We see it all the time and so do many others.
Prayer does work.