When using debounce and setting the DebounceDelay to a high number and navigating away from the page before the delay is triggered results in this error message.Invalid call of the 'CallEvent' client action of the 'MainFlow.Debounce' since the latter is not currently active. This is likely due to a platform's client action being used as an event handler or in a setTimeout function. Consider removing this call by using the 'On Destroy' event of the screen/block or moving your logic to a global client action.
A possible solution is to add a mutation observer that watch for changes in the DOM and If the widget is removed, the debounce timer is cleared, and the observer is disconnected. My modified version looks like this and seems to work so far
A cleaner solution might be to check if the widget still exists on the DOM before executing the function.