No hay mal que por bien no venga.
“There is no bad from which some good does not come.”
Even misfortune can eventually bring an unexpected benefit.
— Traditional Argentina Wisdom, Argentina
Source: Traditional Spanish-language proverb widely used in Argentina, public-domain oral tradition