Sans is actually right, he has mysteriously passed out before! Gaster never did figure out what caused it...
Sans is also pretty freaked out about this but he doesn't want to make Papyrus any more scared or worried than he is so he's trying to play it off. Everything's always a joke to you, Sans!
Yup, as long as Papyrus is around, he's got nothing to worry about...