This is a quote-identification, except I don't actually know the quote. So bear with me, please. It's something like
There is no sin so great that God could not turn it to good.
or
The greatest trick God played on the devil was turning everything he did to good.
or something like that. (Though the second is obviously colored by The Usual Suspects.)
I suspect it's an aphorism from someone like Balthasar Gracian (not him, though) or Meister Eckhart, or it's a quote from Augustine or Francis (any--pick your favorite), or some famous teacher or commentator summarizing/paraphrasing one of the greats.
It could be related to or derived from either of Gn 50:20 or Romans 8:28, or not. It isn't either of those, though.
I tagged it Catholicism because I'm an American Catholic, and went to a Catholic college, and virtually all of my religious education has been from those sources. The ancient Greeks (not likely, though, for this one!), Church Fathers, monastics, Aquinas, &c. are likely suspects. C.S. Lewis, G.K. Chesterton, Thomas Merton....
I probably heard it at least fifteen years ago, so no need to consider 21st-century sources.
Does this ring a bell? Is there a notable quote by a notable author/speaker/teacher in Christianity that fits this mold?