I had the same problem. [Solved]
Qt version 6.4.3 and Qt Creator 11.0.2 on Ubuntu 22.04 running in a VMware virtual machine.
The error happens when switching to the system terminal window (console application under Linux) right after the launch of the debugging session.
In my case opencvtypes.py was already in place.
In Edit -> Preferences -> Environment -> System parameter 'Terminal' was set to: /usr/bin/x-terminal-emulator by default and its sub-parameter Command line arguments used for "Run in terminal" was set to -e again by default.
I tried to change the -e parameter with no success, but when returned to the default values the problem was vanished.