Term: blessing in disguise
Example: the rainstorm was a blessing in disguise
Definition: a problem that becomes a benefit or advantage