I got the same problem with a cheap "non-multimedia" keyboard that I picked up from a "pound shop" (no, honestly). It worked (and works) perfectly with another PC of ours that needed a keyboard, but plugging it into the Pi caused an instant kernel panic.
Somewhere, I read that the power rating of a keyboard can cause this - it occurred whether the thing was connected directly to the Pi or via a powered USB hub, so I wonder how much of an effect the power rating actually had?
Raspberry Pi Model 3B+ (2019) ("ayeka") - CentOS
Raspberry Pi Zero W (2018) ("mass") - Raspbian
Raspberry Pi Model B (1st-gen - 2012) ("ryo-ohki") - Arch Linux ARM