Okay! so, Echo's lore. His universe's Undyne is a bit more aggresive, (HOW CAN AN UNDYNE BE MORE AGGRESIVE?) and was feeling particularly moody today. Sans (classic at this point in the timeline), poofed in and started telling fish puns. she kept getting more and more annoyed as he persisted, and yelled at him to stop. to peeve her, he told another pun. she yelled "ENOUGH!" and summoned a spear, shooting it through his head and out of his right eye. now he has severe PTSD and body dysmorphia. because of this, he put echo flowers into his skull to draw attention away from the cracks and the hole.
^ womp womp lmao TLDR, undyne pulled a horrortale and sans is mentally ill