ToD Sensor Issue

Can anyone identify what’s wrong with my Time of Day binary sensor. The only one not working is “Overnight mode”. It suddenly stopped working, meaning the binary sensor for this mode doesn’t get enabled. 23:59 arrives and the state remains “off”. It makes no sense to me.

- platform: tod
  name: Early Morning Mode
  after: sunrise
  after_offset: '-00:45'
  before: '08:00'

- platform: tod
  name: Morning Mode
  after: '08:00'
  before: '12:00'

- platform: tod
  name: Afternoon Mode
  after: '12:00'
  before: sunset
  before_offset: '-02:30'

- platform: tod
  name: Evening Mode
  after: sunset
  after_offset: '-02:30'
  before: '20:30'

- platform: tod
  name: Night Mode
  after: '20:30'
  before: '23:59'

- platform: tod
  name: Overnight Mode
  after: '23:59'
  before: sunrise
  before_offset: '-00:45'

It can’t ever be both after 23:59 and before sunrise on the same day.

You could do after 0:00 and before sunrise.

Of course. Thank you!!