Interactions/Stuns prohibit any key commands
When being stunned or interacting with something (e.g. gathering) all key commands are disabled. No maps, inventory or anything else can be opened or closed by key command ("I" or "m", etc.). Those menus can still be accessed by clicking on the satchel or equivalent symbol (bottom right of the screen).
I tested this specifically with the Word of Power: Stun from the Crawling Horror and open/closing inventory. It also applies to gathering of plants etc.
Exception to this are all gathering interactions which have a progress bar. In this case, key commands are enabled.
I'd honestly prefer to be able to open my map when I am harvesting things, as that is a nice way to keep checking on your path while not being able to walk anyway.