I have observed a change in behaviour in vim and tiny vim, in Debian 11 (Bullseye). When the window loses focus, vi automatically enters command mode.
To revert to the previous behaviour, where vi will retain the most recent mode, add the following to ~/.vimrc:
set esckeys