You can set 'termwinkey' to a sequence other than <C-W> to use a different keystroke to access the special sequences on the terminal.
See also :help terminal-typing.
TLDR: Make sure that g:submode_keyseqs_to_leave does not include the <esc> key.
Either reset it to an empty list:
let g:submode_keyseqs_to_leave = 
Or double the <esc> key:
let g:submode_keyseqs_to_leave = ['<esc><esc>']
In the latter case, you'll ...
See :h Terminal-mode:
Terminal-Job and Terminal-Normal mode
When the job is running the contents of the terminal is under control of the
job. That includes the cursor position. Typed keys are sent to the job.
The terminal contents can change at any time. This is called Terminal-...
I'm not familiar with mintty, but a quick google search returned the following:
1. mintty tips:
Unexpected behaviour with certain applications (e.g. vim)
If for example the PgUp and PgDn keys do not work in your editor, the
reason may be that in the mintty Options, the Terminal Type was set to
"vt100" and based on the resulting setting of the ...