Hey Alex, sorry to hear you're having trouble detaching your Surface Book's keyboard, especially when the battery seems to be charged. I totally get how inconvenient that can be.
Since you're using a Surface Book 2, one thing to keep in mind is that it actually has two separate batteries, one in the screen it called the “clipboard” and another in the "keyboard base". Sometimes, even if your total battery shows something like 99%, the clipboard battery might still be too low to allow detachment.
To check this, head over to Settings > System > Battery and look at the battery levels for both the screen and the base. If the clipboard battery is low, try charging your device for a bit and then attempt to detach again.
If that doesn’t work, you can try forcing the detach using the Surface Detach app. Just press Ctrl + Alt + Del to open Task Manager, find the Surface Detach Service, and end the task. After that, try pressing the detach button again.
Also, if you haven’t already, I recommend running the Surface Diagnostic Toolkit. It’s a handy tool built by Microsoft that can help identify and fix software or driver issues that might be causing the problem.
Hope this helps.
Kind Regards,
John Oli