My Lock Door after 20 seconds of being closed automation is no longer working

So this automation has been working for me for months but since I updated to the newest version of HA it just stopped working. It’s supposed to lock my front door when it’s been closed for 20 seconds after 8pm and before 9am. I’ve used # to figure out where its going wrong and its for the for: section of the trigger. I can’t seem to find anything about a change so I figured I would ask on here. Any help would be appreciated. Here’s the automation.

id: a_lock_door_sensor_20secs_after_8pm
alias: Lock Door Sensor 20 Secs After 8pm
  platform: state
  entity_id: binary_sensor.front_door_8
  to: 'off'
    seconds: 20
  condition: and
  - condition: state
    entity_id: input_boolean.out_front_mode
    state: 'off'
  - condition: or
    - condition: time
      after: '20:00:00'
    - condition: time
      before: '09:00:00'
- service: lock.lock
  entity_id: lock.front_door_deadbolt_60
- service: notify.ios_all
    title: Automatic Lock
    message: The Front Door Has Been Locked