Can you help find a parable, possibly Jewish, about calculating or predicting consequences of events?

Can you help find a parable, possibly Jewish, about calculating or predicting consequences of events?

The idea is how one seemingly bad event leads to something good which leads to something bad which leads again to good, all unexpectedly in a chain. E.g., a man gets thrown off the horse and breaks a leg which prevents him from being drafted into the army, etc.