Can give some context for this bug as am constantly now running into it, and have lost at least one base defence by backing into spawn and triggering the screen.
Bug first triggers when entering a shop with a queued item (that is not an upgrade to a currently held item), all slots available filled, and enough souls to buy the queued item. Shop will pop up to get the player to sell an item, but the players skills section (Four skill buttons at bottom centre of skill) overlays the shop sell/exit buttons, hitting the Escape key brings up the main menu rather than exiting the shop. Hovering over either button will trigger the skill prompts as priority (box explaining the skills stats and function), and while also indicating the players clicks (buttons will indicate being clicked and items can be selected in menu) the shop menu fails to allow standard buy/exit inputs.
Current work arounds I have found to this issue;
-Disconnect and immediately reconnect
-Spend any stored skill points to upgrade a skill (this appears to clear the glitch, allowing the Escape key to exit the shop, rather than bring up main menu).
-Wait out the glitch and eventually it seems to allow the menu to close
Would guess this is down to the skill layer being priority over the shop layer