But I agree with posters who say when it's human action that causes an issue it's not the victim in the wrong place or wrong time.
The perpetrator is 100% in the wrong
The perpetrator can be 100% in the wrong and the phrase still be valid - and comforting to those who use it.
My friends were killed in a car accident. A drunk driver came around a bend too fast and crashed into them. If they'd have been a few seconds earlier or later, they would still be alive and not dead at just 18 years old.
It is 100% the drunk driver's fault that they died.
Doesn't stop it also being true that if they'd have just been a few seconds earlier or later, or decided to sleep at the other friend's house instead of driving home on that road that night, they would have lived. It was a horrible coincidence/twist of fate that they just happened to be in the exact path of the out of control vehicle at the exact time that it flew across the road. What other way of expressing that thought is there? Because it is a thought that went through our heads a lot in the aftermath. If they'd have just this, if only that, if only the traffic lights had've been red and held them back a minute or two longer, if only we'd have chatted a bit less before they left... but it was just a tragic case of them being at X marks the spot at exactly Y time.
As their friends, we used the phrase a lot to discuss it. I can't remember much of one funeral but I can remember at the other funeral her poor dad using the phrase in the eulogy. It was a phrase that helped a lot of us 17 and 18 year olds make "sense" of a senseless situation.
Never once was it used to excuse the primary cause of the accident: the drunk driver (who also lost his life in the accident).