I think it's been long overdue for me to talk about what happened to Sans after I promised I would, so, here we are!
When I said I threw him in the Void, I was not lying dgshshf.
Sans had been somewhat involved with the efforts to revive Papyrus after he died. Chara came to him with the idea, and he was the one who provided them with Papyrus' scarf/cape, which was what a lot of his dust had settled in.
Sans wasn't totally on board with the plan and was skeptical that it would work (since, y'know, people who die aren't supposed to come back from that). But a tiny part of him still wanted to have hope that maybe he would get to see his brother again. Ultimately though, Chara's safety was more of a priority to him. Tori'd kill him if he let her kid get hurt on his watch, after all. So, I'd say that he did make some half-hearted attempt to discourage Chara from trying to revive Papyrus, but also didn't actually do anything to stop them when they insisted on going through with it.
As I've said before, Chara had less Determination available to work with compared to Alphys when she did her experiments. Alphys had extracted all of her samples from the human SOULs that had been collected (as mentioned in canon in the True Lab). Those SOULs disappeared after Frisk's battle against Omega Flowey, though, so Chara wasn't able to do the same. They found and used the leftover Determination that Alphys had previously collected, but it wasn't enough. So, from there they had two options to get more:
They extract some from the Amalgamates (not actually an option; the process could be painful, they refuse to harm a monster, absolutely not, no way are they doing this)
They extract some from their own SOUL.
In Chara's mind, there was only one choice.
So, with Sans' hesitant supervision, they hooked themself up to the DT Extraction machine.
However, as I'll get into some other time, Chara's SOUL is massively Fucked Up. Their Determination is pretty much the only thing holding it together.
Y'know, the very same Determination being extracted from them?
So, because the extraction process is basically killing them, they try to RESET on reflex. However, their ability to RESET also depends on the amount of Determination they have. Which they are currently in the process of losing.
This put the timeline in a weird, unnatural state of an incomplete RESET, causing time, space, and reality as a whole to begin tearing itself apart.
Sans intervened at that point, terminating the extraction process early and saving Chara's life as a result. However, his interference forced him to get very close to the source of the space-time disruptions (and thus where the destruction of reality was at its worst). He, unfortunately, got sucked into that whole mess, causing him to get sent to the Void and erasing him from the minds and memory of every living person in the process.
So! Sans got Gaster-ed lmao rip. Though actually, his erasure wasn't as complete as Gaster's was. Gaster got erased from all of existence entirely, whereas Sans has only been erased from his specific timeline (and all the other timeline iterations that branched off after his erasure). He exists outside of time now, watching over the world that he can no longer interact with. If anyone here happens to be familiar with Chrono Trigger, I'd say Sans' situation is somewhere in between Gaster's and Gaspar's. ...Funny how their names are. Fairly similar actually dgssgf
As for the out-of-universe reason why I threw Sans in the Void, it's the best way to make his role as the "game's" narrator work. Being a monster instead of a human, it doesn't make sense for him to have some sort of "soul connection" or something with Trace that Chara had with Frisk and/or the player.
So, he doesn't! But by existing outside of time, space, and the game itself to some extent, he, similarly to Gaster in Deltarune, is aware of and interacts directly with the player. Trace themself doesn't actually know about Sans' presence for most of their adventure. All of the narration and UI stuff is Sans talking to and interacting directly with the player specifically.