Word or phrase for something that turns out great but wasn't intended as such
There is the well known proverb
Mighty oaks from little acorns grow.
Proverb
Mighty oaks from little acorns grow
Something great can come from a modest beginning.
- Don't give up on the project – mighty oaks from little acorns grow!
[Wiktionary]
This is probably more often used as an encouragement than an observation.
I prefer the W C Fields adaptation;
'From the little acorn ...
the mighty oak did grow.'
I'm assuming you're looking for a word since the title says that. I remember having read somewhere Charles Goodyear's accidental discovery of vulcanization being described as serendipity. I believe that should apply to the context you've provided as well:
The faculty of making fortunate discoveries by accident.
The fact or occurrence of such discoveries.
[American Heritage Dictionary]