Sometimes our loved ones CHOOSE to leave when we are not present, on purpose, to make it easier on both.
My husband and I discussed it before he died, he wanted me there and I wanted to be there. I was the only one there at his request. It was very VERY hard for me, and if you have never watched a loved one die, I don't recommend it. My husband lived two days longer than the hospice Dr. said he would, and that's my fault for selfishly not wanting him to go. Finally I realized it, and I told him it was OK to go, that I'd be OK.
He died the next day, in my arms.
Some people are just the opposite, they want you to remember them as they were, alive and vibrant. Therefore they purposely spare you the image of their death playing over and over in an endless loop in the cinema of your mind for the rest of your life.
Don't BLAME yourself if a loved one died while you went out for a minute or were out of town or at work or anywhere doing what you needed to do, because everything happens for a reason and there is no such thing as coincidence.