Huh, but there is no 1 second gap between 23:59:59 and 00:00:00. The time is 23:59:59 for a whole second, and then once that second is done, the time is 00:00:00 the next day.
23:59:59.500 is after 23:59:59 when interpreted as an instant, but it is part of 23:59:59 as a duration.