Cowper's hymn is a perfect example; for he wrote it shortly after he had a depressive breakdown, and thereafter because of His illness became convinced for the remainder of his life that God had destined him to destruction.
Doubtless many righteous and godly men would have been praying for his recovery, but God always has a better plan, for us, for His people.
Little did Cowper know that he and his mate John Newton together would become two of the greatest hymn writers ever.
Indeed, God's frowning providence is mysterious, and His grace toward the elect will always shine through at the end, even when it is tempting to assume otherwise.