Rule condition is not working

Hello,

I have a handoff rule that is supposed to hand the issue to a live agent if the user tries to handoff in the middle of a form:

- rule: bot handoffs form_connect_general
  condition:
  - active_loop: form_connect_general
  steps:
  - intent: handoff
  - action: action_deactivate_loop
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: utter_handoff
  - action: action_handoff

However, after testing it with rasa interactive, I get some weird behavior:

Chat History

 #    Bot                                                                                                                                                                                     You        
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 1    action_listen                                                                                                                                                                                      
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 2                                                                                                                                                                       [cant](deny) [connect](connect) 
                                                                                                                                                                              intent: issue.connect 1.00 
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 3    slot{"connect_error_type": "utc"}                                                                                                                                                                  
      form_connect_general 0.87                                                                                                                                                                          
      active_loop{"name": "form_connect_general"}                                                                                                                                                        
      slot{"requested_slot": "any_device"}                                                                                                                                                               
      To help in solving your connection problem I need to know what operating system you're using. Choose one from the list  below or type your specific OS in the                                      
      message field!                                                                                                                                                                                     
      Buttons:                                                                                                                                                                                           
      1: Windows (windows)                                                                                                                                                                               
      2: macOS (macos)                                                                                                                                                                                   
      3: Linux (linux)                                                                                                                                                                                   
      4: Android (android)                                                                                                                                                                               
      5: iOS (ios)                                                                                                                                                                                       
      Type out your own message...                                                                                                                                                                       
      action_listen 1.00                                                                                                                                                                                 
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 4                                                                                                                                                                          [live](human) [agent](human) 
                                                                                                                                                                                    intent: handoff 1.00 
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 5    slot{"handoff_type": "h_human"}

And policy logs:

2022-12-19 13:33:21 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 26 events.
2022-12-19 13:33:21 DEBUG    rasa.core.actions.action  - Validating extracted slots: 
2022-12-19 13:33:21 DEBUG    rasa.core.actions.action  - Calling action endpoint to run action 'action_validate_slot_mappings'.
2022-12-19 13:33:21 DEBUG    rasa.core.processor  - Default action 'action_extract_slots' was executed, resulting in 1 events: SlotSet(key: handoff_type, value: h_human)
2022-12-19 13:33:21 DEBUG    rasa.core.lock_store  - Deleted lock for conversation 'fdda6f19814b4127bd16810f833bfac0'.
2022-12-19 13:33:21 DEBUG    rasa.core.tracker_store  - Recreating tracker for id 'fdda6f19814b4127bd16810f833bfac0'
? Is the intent 'handoff' correct for '[live](human) [agent](human)' and are all entities labeled correctly? Yes
2022-12-19 13:33:25 DEBUG    rasa.core.tracker_store  - Recreating tracker for id 'fdda6f19814b4127bd16810f833bfac0'
2022-12-19 13:33:25 DEBUG    rasa.core.tracker_store  - Recreating tracker for id 'fdda6f19814b4127bd16810f833bfac0'
2022-12-19 13:33:25 DEBUG    rasa.engine.runner.dask  - Running graph with inputs: {'__tracker__': <rasa.shared.core.trackers.DialogueStateTracker object at 0x2883b8d00>}, targets: ['select_prediction'] and ExecutionContext(model_id='065e07a611aa48f58a1ae31a28410e59', should_add_diagnostic_data=False, is_finetuning=False, node_name=None).
2022-12-19 13:33:25 DEBUG    rasa.engine.graph  - Node 'rule_only_data_provider' running 'RuleOnlyDataProvider.provide'.
2022-12-19 13:33:25 DEBUG    rasa.engine.graph  - Node 'domain_provider' running 'DomainProvider.provide_inference'.
2022-12-19 13:33:25 DEBUG    rasa.engine.graph  - Node 'run_MemoizationPolicy0' running 'MemoizationPolicy.predict_action_probabilities'.
2022-12-19 13:33:25 DEBUG    rasa.core.policies.memoization  - Current tracker state:
[state 0] slots: {'is_restricted': (1.0, 0.0)}
[state 1] user intent: issue.connect | user entities: ('connect', 'deny') | previous action name: action_listen | slots: {'is_restricted': (1.0, 0.0)}
[state 2] user intent: issue.connect | user entities: ('connect', 'deny') | previous action name: form_connect_general | slots: {'is_restricted': (1.0, 0.0)}
[state 3] user intent: handoff | user entities: ('human',) | previous action name: action_listen | slots: {'is_restricted': (1.0, 0.0)}
2022-12-19 13:33:25 DEBUG    rasa.core.policies.memoization  - There is no memorised next action
2022-12-19 13:33:25 DEBUG    rasa.engine.graph  - Node 'run_RulePolicy1' running 'RulePolicy.predict_action_probabilities'.
2022-12-19 13:33:25 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
[state 0] slots: {'is_restricted': (1.0, 0.0)}
[state 1] user intent: issue.connect | user entities: ('connect', 'deny') | previous action name: action_listen | slots: {'is_restricted': (1.0, 0.0)}
[state 2] user intent: issue.connect | user entities: ('connect', 'deny') | previous action name: form_connect_general | active loop: {'name': 'form_connect_general'} | slots: {'is_restricted': (1.0, 0.0)}
[state 3] user text: live agent | previous action name: action_listen | active loop: {'name': 'form_connect_general'} | slots: {'is_restricted': (1.0, 0.0)}
2022-12-19 13:33:25 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
2022-12-19 13:33:25 DEBUG    rasa.core.policies.rule_policy  - Predicted loop 'form_connect_general'.
2022-12-19 13:33:25 DEBUG    rasa.engine.graph  - Node 'run_TEDPolicy2' running 'TEDPolicy.predict_action_probabilities'.
2022-12-19 13:33:25 DEBUG    rasa.core.policies.ted_policy  - TED predicted 'action_deactivate_loop' based on user intent.
2022-12-19 13:33:25 DEBUG    rasa.engine.graph  - Node 'select_prediction' running 'DefaultPolicyPredictionEnsemble.combine_predictions_from_kwargs'.
2022-12-19 13:33:25 DEBUG    rasa.core.policies.ensemble  - Made prediction using user intent.
2022-12-19 13:33:25 DEBUG    rasa.core.policies.ensemble  - Added `DefinePrevUserUtteredFeaturization(False)` event.
2022-12-19 13:33:25 DEBUG    rasa.core.policies.ensemble  - Predicted next action using RulePolicy.
2022-12-19 13:33:25 DEBUG    rasa.core.tracker_store  - Recreating tracker for id 'fdda6f19814b4127bd16810f833bfac0'

What i don’t understand is why it calls the form again instead of action_deactivate_loop and why the rule policy says there is no rule, but still predicts?