Bitter pills may have blessed effects.
"Present afflictions may tend to our future good."
James Kelly (1818). A Complete Collection of Scottish Proverbs Explained and Made Intelligible to the English Reader. Rodwell and Martin. p. 43.
Mieder, Wolfgang; Kingsbury, Stewart A.; Harder, Kelsie B. (1992). A Dictionary of American proverbs. pp. 710. , p. 128