Due to the reproducible nature of it, I assume this is not exactly a bug. Depending on where you are at the game flow, the Esc key seems to immediately remove you one level up out of the code or cancel a selected action.
Esc at the main menu, immediately closes the program.
Esc at the “Battle Map”, will bring you to the main menu (but see below)
Esc at the “Pre-Deployment” screen, where you can change equipment, will bring you to the Battle Map with your current load out.
Esc after you have selected a skill but not selected a target will cancel the use of the skill but keep you in the battle map.
Esc after you have selected a move (but not confirmed it), will cancel the planned move, but keep you in the battle map.
With respect, I would have expected Esc at the battle map and “Pre-deployment” screen to pull up an in game menu, perhaps with sound/video settings and a button (or secondary key press, from a key other than Esc) to quit to the main menu. Especially since Esc was also used to cancel moves and skills. Instead, an accidental Esc or two can remove you out from the program so quickly that I thought it had crashed at first (until I checked the log).
I would suggest either have the battle map form a prompt (or menu screen) when you press Esc, so you can confirm before leaving the battle or using a different key binding for “cancel skill/movement” or for “immediately exit the battle map” (such as Alt+F4 for the second).
Other than that, it looks amazing for a pre-alpha game. Can’t wait to see what you do with the strategic side of things.