The fact that the pen tray is not charging is a very strong indicator of a hardware-level power failure in the keyboard itself — because pen charging power comes entirely through the keyboard's pogo pin connector from the Surface. Here's how to confirm it:
Press the Caps Lock and Fn keys on the keyboard a couple of times and check whether the LED lights turn on and off. If the LED lights do not turn on at all, Microsoft's own guidance confirms this indicates a hardware issue with the keyboard.
If there's no LED response whatsoever, that's your definitive proof the keyboard has failed — no software fix will help.
Turn off your Surface and wait 10 seconds. Press and hold the Volume Up button, then press and release the Power button. Continue holding Volume Up until the UEFI screen appears. In UEFI, try pressing the Up/Down arrow keys to navigate the menu. If the keyboard does not respond even in UEFI, the fault is definitively hardware — it's not a Windows or driver issue at all.
If it also doesn't work in UEFI → keyboard is confirmed dead hardware.
Before concluding it's dead, do one clean restart:
Press and hold the power button for 20 seconds — even if the logo screen appears partway through, keep holding for the full 20 seconds until you see it a second time. Then reattach the keyboard firmly, ensuring all magnets contact the bottom edge of the Surface.
The Slim Pen charges only through the keyboard's internal circuitry — it gets no power unless the keyboard itself is receiving and distributing power from the Surface.