To trouble shoot further you can:
—A SafeBoot Start up your Mac in safe mode - Apple Support will sort many anomalies
Does a quick disk repair before it fully boots up, and certain system caches get cleared and rebuilt, third party system modifications and system accelerations are disabled temporarily.
Login and test. Reboot as normal and test. Caches get rebuilt automatically.
This test will tell you if third party interference; most extensions etc are not loaded in safe boot mode.
—Test issue in another user (or guest user) account Change Users & Groups settings on Mac - Apple Support
This will tell you if it a universal issue or isolated to your user/admin account.
***if you have a wireless keyboard with rechargeable batteries connect the charging cable before booting to Safe Mode.
This will make it act as a wired keyboard and will result in a successful Safe Boot mode.
unplug all non-essential peripherals when testing
Uninstall all third party apps that are Cleaners/Optimizers/VPN/Anti-Virus
all known to cause issues on the macOS
Kernel Panics are predominately caused by hardware faults or faulty third-party kernel extensions.
Learn what to do if your computer restarts or shuts down unexpectedly, or you get a message that your computer restarted or shut down because of a problem.
If your Mac restarted because of a problem - Apple Support