So, in this question we learned that Miguel ran to Mama Coco, since she was the only one whose memories were valid to keep Hector "alive" in the dead world.
However, when Miguel arrives to his house, at least to me it seems that, if not about to die, Mama Coco clearly doesn't recognize anyone anymore. We don't know when that behavior starts, but considering what's going on with Hector in the dead world (he's almost gone), Mama Coco completely forgets everyone a couple of seconds after the sunrise, including Hector.
So, what happened between the moment she forgets him and the moment Miguel starts to sing "Remember Me"? It could easily be like 2 or 3 minutes. Did Hector vanish and then got back to "life"?