Or more aptly, "Thank God", which is a common exclamation.
I even say it.
Or "bless you" when people sneeze.
I think the expression the person is trying to convey is pushed aside when someone takes offense to the words the person uses to express it.
It doesn't matter whether they were being sympathetic or comforting, as now they are shunned because the words, that they took no thought to have to guard, offended someone.