The way I see it, Undertale was a prototype for deltarune, not in a lore sense but in the sense that toby was just testing with undertale since deltarune is his dream game, and hes only reusing characters because he thinks they were cool enough to have a spot in his dream game.