I have also had the same problem and made report on MC-301599 . These all seem to be the same issue. Escaping from an interface block UI just seems to instantly reopen it (because the key gets stuck “on” and keeps clicking). I have managed to move the cursor rapidly while repeatedly hitting escape and get out of it, but then it just starts placing blocks (or torches) like crazy and activating doors or anything else your cursor passes over until you either quit or tab out and back.
I couldn’t move the cursor fast enough while rapidly hitting the escape key to show how I could stop it from instantly re-opening while holding my phone to record it (which is hard enough to make happen even when trying to do it with two free hands). But as I said above, doing that would cause me to rapidly place blocks or flip the door open and close over and over again without hitting any keys (as if the action key was being held down).
I think I am having this same issue. Makes playing the game in this snapshot near impossible. Every time you interact with any interface block (chest, crafting table, etc.) the action key becomes “stuck” on and you can’t really get out of it. Escaping just reopens it, and if you manage to get the focus to move in the split second before that happens (which is hard) it’s like the key is stuck on as it starts placing tons of torches (in my off hand) on every block I face until I close or minimize the game and come back into it.
Just loaded the new snapshot (25w36b) to see if it continues and it seems to be working just fine now. Either it has been found and fixed (which would be great) or whatever was causing it has been altered enough for other reasons to make it work again for now (which is a bit scary).