Behold therefore the goodness and severity of God: on them which fell, severity; but toward thee, goodness, if thou continue in [his] goodness: otherwise thou also shalt be cut off.
Note 3 at Ro 11:22: Even in the midst of God's judgment, there is mercy. The people who suffered destruction during the Flood and the overthrow of Sodom and Gomorrah experienced the severity of God, but these judgments were actually acts of mercy upon the world as a whole. During those times, sin was so rampant in the earth that it was like a cancer. God did radical surgery on mankind by removing these vile sinners and therefore allowed the human race as a whole to survive.
Likewise, God's turning from the Jewish nation to the Gentiles had both severity and goodness in it. It had severe consequences for the Jews, but it blessed the rest of the world.