problem solved:
you have to deactivate the AI button
settings— more settings— key bindings— AI button
switch every option to "none / nothing"
I found this by further searching
Hello, i have the same problem with mi 9
with both roms:
12.0.1 Global
12.0.3 Global (QFAEUXM).
deactivating the rights of gboard for the microphone did not change the problem.
when charging the smartphone the issue is not present.