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
trigger:
  platform: state
  entity_id: binary_sensor.front_door_8
  to: 'off'
  for:
    seconds: 20
condition:
  condition: and
  conditions:
  - condition: state
    entity_id: input_boolean.out_front_mode
    state: 'off'
  - condition: or
    conditions:
    - condition: time
      after: '20:00:00'
    - condition: time
      before: '09:00:00'
action:
- service: lock.lock
  entity_id: lock.front_door_deadbolt_60
- service: notify.ios_all
  data:
    title: Automatic Lock
    message: The Front Door Has Been Locked