Sirach 20:9

9
[Sometimes] it is advantageous for a man to be in adversity,And there is a gain that turns to loss.