Well the answer isn’t to rewrite what we saw in the game.. ugh. Hold on to your copies of Oot, I see a version where Link fails at the end..The canon explanation for a hot minute was that Ocarina of Time created a split timeline leading to a fork in the timestream.
1) In the first first Link is sent back in time by future Zelda and does unclear things leading to a prematurely defeated Ganon. This is the timeline where Twilight Princess takes place.
2) In the second fork, the doomed timeline continues to live on. Ganon is sealed away and things begin to recover, but he eventually returns. This is where Wind Waker picks up.