This answer part references GPT, GPT_Pro better solve the problem
The possible cause of this problem is: there is a problem with the keyboard or keyboard driver. First, check to see if the keyboard driver is the latest version. If not, try upgrading to the latest version. If so, check to see if the device manager on your system reports any errors with the keyboard. If so, try fixing or reinstalling the driver for the keyboard; If not, try another old keyboard and see if it works.
Also, try using a debugging tool to check that the keyboard pins in your system are working correctly. If the pins are abnormal, the system may restart. In addition, you are advised to set USB Legacy Support in the BIOS to Enabled so that the USB device can be used normally.
In short, the computer restart after inserting the keyboard may be caused by the keyboard or keyboard driver problems, it is recommended to check and repair according to the above content.
If the answer is helpful, please accept it.