Yes it is "thanks to a merciful God." It is thanks also to a faithful God of compassion.
According to Jeremiah it is [always] because of "the mercies of the Lord that we are not consumed . . . His compassions do not fail . . . . great is [His] faithfulness" (Lamentations 3:22, 23).
But I am reminded that the perfections of His mercy, His compassion, and His faithfulness remain just a perfect and pure even if there is no healing.
Job knew this, as did Esther, and as did also the three Hebrew children. (Job 13:15; Esther 4:16; Daniel 3:18).
If that time should come for any of us, may we all have the strong trust to say, "Though I am not delivered, I will still give thanks to a Most Merciful God."