The genocide ending (it ends in two ways depending on how you interact with Chara) doesn’t end like that.
If you press on with “ERASE”, she then kills you and the rest of the timeline, as you move on to the next. If you press “DO NOT”, Chara will jumpscare you and kills you and the rest of the timeline.