This was reported a few times but it doesn’t seem to be an issue caused by Krita even though it manifests itself there. We were always able to find other software to be the culprit or it being a hardware issue (keyboard broken, it stopped happening when unplugged). The fact that some of your keyboard’s buttons don’t work sounds like it’s an issue with the keyboard. As a workaround you could try to unbind the ‘insert’ key in Krita’s shortcut settings. That’s the default keyboard shortcut set to ‘add paint layer’.
Here are a few examples
I assume the insertion of layers stops when Krita doesn’t have focus? This indicates that it gets the signal from something outside.
This could also mean that the application that was interfering with Krita was just not running at the time. You could try stopping other programs running on your system until it stops happening. Possibly it’s one of these applications that automatically start when you start your computer. Some trashy antivirus, suspicious chat software, a windows “enhancement” software (CC-cleaner or similar scare-ware) or one of those bloatware applications that the manufacturer preinstall on the laptop before you buy it. Make sure they’re actually turned off, not just minified to a tray icon or something.
Also where did you get your Krita installation from?