Wait_for_trigger automation never continues despite being true

I encountered a similar issue with an automation to turn off lights when there is no more motion, where I was also struggling to use wait_for_trigger because motion was already off. I solved this by adding an if statement to first verify the condition/state and move the wait to the else clause. Probably not the cleanest solution but it works.

principle:

if 
  value = off
then 
  do action 
else 
  wait_for_trigger 
    to: off
  do action

actual config:

action:
  - if:
      - condition: state
        entity_id: group.motion_sensors
        state: "off"
        for:
          seconds: 0
    then:
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.mylight_on_off
    else:
      - wait_for_trigger:
          - platform: state
            entity_id:
              - group.motion_sensors
            to: "off"
            for:
              seconds: 1
        continue_on_timeout: false
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.my_light_on_off
mode: single