Du weißt gar nicht, was du versäumt hast.

What is the difference between “versäumt” and “verpasst”? I know you would use “verpasst” for a missed train and “versäumen” can also be used in the case of failure or neglect, like a student not doing their homework, and you wouldn’t use “verpassen” then, but are there any other differences?

versäumen isn’t used as much nowadays and it is mostly used as a direct substitute for verpassen that often turns out to sound a bit off, as it is the case in the given sentence.
er hat seine hausaufgaben versäumt would be a bit archaic and frankly spoken, I am not even sure if it is right since we mostly use verpassen/versäumen referencing an event* but not a task.

*as in: Ich habe die Abgabe verpasst/Ich habe den Zug verpasst/Ich habe die Aufführung verpasst/Ich habe seinen Besuch verpasst