The actual phrase is something like, "There but the grace of God go I." K, the grammar can change it around. Like another popular refrain, this little phrase is to be found nowhere in the Bible. Its source is a matter of widespread conjecture, but it has been a popular phrase for decades, and probably since the late 1800's. The words may sound poetic (they are not in Shakespeare either), but it's what this phrase says about God's grace that's ugly.
Because it teaches that God's grace is with those who avert a disaster, but not for those who suffer tragedy, I have no use for it. Further, I have to conclude that those who use it do so in ignorance, since I have no idea of their intentions. A clergywoman, from a wheelchair, taught me this: that when we use this and phrases like it, we show ourselves to be clueless about the amazing grace of God in Father, Son, and Holy Spirit or the recipients of God's grace. Too, we declare those who suffer various calamities, from terminal illness to death row to accidental death, to be outside the grace of God.
Jesus tried to answer this question in different ways. About the man born blind in John 9, Jesus' disciples asked, "Rabbi, who sinned, this man or his parents, that he was born blind?" Jesus' retort was "Neither this man nor his parents sinned." Do you hear that? God's grace is not about who is in or who is out. It IS about God, the creator of the universe, being available to all living things! (Psalm 104) Elsewhere, Jesus is clear about it: tragedies do not happen to anyone because the people involved are worse sinners (Luke 13)
So while we are comfortable putting parameters on life, having bad things happen to bad people, having good things happen to good people, we cannot have life- or God's grace- on our terms. Wealth doesn't protect us, for example (Prov. 18:11) We live in the terrible freedom of our own choosing and sometimes the consequences simply cannot be known. We may find it difficult to handle happenstance, but it does no good to make up goofy stuff about God's grace that just isn't true. All this may make us feel better for the moment, but it leads to a denial of the God who doesn't play by our rules anyway.
No, God's grace is with all of us, all of the time, even those of us who don't know it. God is there when we reach out to him no matter the circumstance. There is nothing (not even our own small mindedness) that will be able to separate us from God's love in Jesus. (Romans 8). This is the faith worth living for- and dying for.