When the light flashed, 3 things happened at once.
Sans tried to grab Gaster again, this time succeeding in pulling the old scientist into reality, but not before Chara had grabbed onto Gaster- forcing themselves into reality along with him.
The third thing, the DT Extractor exploded at the same instant that Gaster and Chara were brought into reality.
Sans was far enough away to be safe from the main blast, though the outward force still knocked him down. The others, weren't as lucky.
He rushed over to check on them, starting with Frisk. As if it wasn't bad enough that Frisk had been weakened by using the DT Extractor, they had also been the closest to the blast and were pretty badly injured, as well as unconscious now. Gaster didn't seem injured at all, but Sans was unable to wake him up no matter what he tried. The same seemed to be true for Chara and Flowey as well, no visible injuries but unconscious to the point that he woulda thought they were dead if it weren't for the fact that he could tell Chara was breathing.
He moved all of them to the infirmary in Alphys' lab before leaving to get Alphys herself, explaining what had happened to her on the way back.
A few days later, Alphys had healed all of Frisk's injuries, but despite not being hurt anymore they were still unconscious along with the other 3. Finally, Alphys checked all of their DT levels, and found out that they were all extremely low on Determination but had not fallen down. She decided to try injecting them all once a day with the smallest amount of DT possible, hoping that by raising their levels slowly they would all wake up without any adverse side effects.
In a week, her plan showed successful. Frisk and the others all woke up within minutes of each other, although something seemed... off about them all.
Chara was the first to try to speak or move, but at Sans' suggestion Alphys had restrained them in case they were to try something.. dangerous. "Um, where... why can't I move? Where am I?"
Gaster was awake before Chara, but had not said or done anything other than stare at the ceiling until he heard the child speak. "This place feels like it should be familiar..."