I have this. Had it nearly every night for 5 years. As soon as i start to cross the barrier into sleep, my body goes into this panic and does everything it can to wake me up. It's instant, like i got struck with a lightening bolt.
After several doctors telling me i needed a psychiatrist, finally one told me this is dysautonomia. That's fairly common with us so a symptom of die-off from a new antibiotic sounds reasonable to me. Little more brain inflammation
Hopefully an increase in detoxing will help but as scary as it is, it's normal i guess. For me actually, the only thing that helps once that starts is keeping myself awake for a bit and it fades away. Sorry you're experiencing this