While trying to use input subscription events to close UI and switch between an action map for the player (PlayerView) and action map for spaceship weapon control (WeaponView), I encounter an Assertion failed error.
The below function is called through subscription to a button action bound to keyboard “ESC” key to switch from PlayerView to WeaponView (which works fine).

however when switching from WeaponView to PlayerView it throws the below error:
below is the function used to toggle the UI:

Through testing, for some reason the error is only fired when both the SetActive for the UI GameObject prefab and the SwitchCurrentActionMap occurs in the same frame. After the error fires, the action map remains at the previous one, i.e. it doesnt change, remaining at WeaponView.
This also freezes all input, even the movement input (which is handled by another actionmap which is enabled separately and kept on always).
However, upon pressing “ESC” key again movement returns and the WeaponView correctly switches to PlayerView).
Any idea what’s going on here?
