A blessing in disguise.

Meaning :
Something good that isn’t recognized at first.


Example :

The new posting to another country, was actually a blessing in disguise for Tom.