The older MacBook Pros with Touch-Bar and without a Hardware Esc Key for me have the very annoying flaw of often triggering Esc mistakenly. There are some suggestions for re-mappings, which don't work well. My suggestion would be a Toolbox utility, which once activated only recognizes an Esc touchbar key-press, if one also presses the Fn key (for me it's OK, that this toggles the touch-bar to the Fn-keys if enabled as well).