He was most likely lost consciousness for a moment..
Take Sugar and Moria for example..When they lost consciousness for a moment people who were trapped in their df ability for years freed afterwards..
It's a state between sleep and death..So luffy wasn't actually died .
Most likely when he lost consciousness , it triggered his awakening.
Kaido pushed him to his outmost limit..To reach that limit