I wish people would spend their time and energy on working to make things better, and doing the best they can in the face of loss. Rather than wasting their time on "magical" nonsense. You point out exactly why prayer means nothing in cases like this. The idea that an all loving God would allow someone to become sick, but then heal them, because another human being prayed for them ... Well, That's the kind of religious teaching that convinced me that religion is simply superstitious nonsense.
Because clearly, that position is not tenable, but people keep teaching it anyway. They are fools.