Trigger function not working in asynchronous function call?

Hi, I have a code with a simplified version here, with an asynchronous function:

    category_Triggers<public><localizes>:message := "Triggers to/from this device"

    componentTip_endTrigger<public><localizes>:message := "Activates AFTER this device finishes all waves"
    @editable:
        Categories := array{category_Triggers}
        ToolTip := componentTip_endTrigger
    endTrigger : trigger_device = trigger_device{}


    # ------------------------------- Device start -------------------------------
    OnBegin<override>()<suspends>:void=

        # first check if this device is "enabled" by trigger
        enableTrigger.TriggeredEvent.Subscribe(enable_npcRoundManagerDevice) # enableTrigger is an editable variable defined earlier 

    enable_npcRoundManagerDevice(Agent : ?agent):void =
        # function to start spawning NPCs

        startTrigger.TriggeredEvent.Subscribe(start_npcRoundManagerDevice) # startTrigger is an editable variable defined earlier 

    start_npcRoundManagerDevice(Agent : ?agent):void =
        # call asynchronous function
        spawn{npcRoundSpawn_async()}



    npcRoundSpawn_async()<suspends>:void =


        # loops and things happening here, Sleep function called, etc taken out to simplify
        # -----
        # -----


        #end of function - do end trigger signal
        endTrigger.Trigger
        Print("NPC device --- DONE, end trigger activated")

The message “NPC device — DONE, end trigger activated” gets printed in the output log but the trigger device hooked up to this endTrigger does not seem to get activated at all. I double checked the in-game trigger device is enabled while during the game.

Is this a bug or any thoughts what to check?

endTrigger.Trigger(), you’re just keeping a reference to the method otherwise, also you shouldn’t subscribe dynamically like you’re doing, it can lead to infinite subscriptions