I have the same issue, no troubleshooting guide that Microsoft has solves anything. And their help desk just wants me to pay because i'm out of warranty. I love the surface, but this makes me never want a surface device again. How have they not patched a fix for this, it seems that many people have this issue. It cant just be a coincidence. My keyboard works on other devices, but no keyboard works on mine. I have only used it as a desktop with the dock and never dropped or mishandled it.
I have the sp4 already cleaned the ports, did the 2 button power cycle, reinstalled the drivers, verified windows was updated, and factory reset my device