There are unfortunately many people with this issue (including a neighbor and a
friend). For most, the problem occurs after some random Windows Update. My
theory is that it isn't a particular update, but something in the update PROCESS
that corrupts the firmware somehow. Microsoft has not commented on this, nor
have they come up with a fix.
If it does not work in the UEFI, no amount of reimaging will fix it. Cleaning
the contacts has not fixed this for anyone.
The UEFI settings can be adjusted only during system startup. To load the UEFI
firmware settings menu:
- Shut down your Surface and wait 10 seconds.
- Press and hold the volume-up button on your Surface and at the same
time, press and release the power button.
- The Microsoft or Surface logo appears on your screen. Continue to
hold the volume-up button. Release the button once the UEFI screen appears.
See:
https://answers.microsoft.com/en-us/surface/forum/surfaccesso-surfkeyboard/surface-pro-4-jul-2017-update-type-cover-not/1c188925-c234-4369-8c93-af74417534d1
and other threads
https://www.computerworld.com/article/3215225/microsoft-windows/surface-pro-4-type-cover-suddenly-stops-working.html
Your only official solution is to spend $450US for an out of warranty refurb
exchange.
You can also investigate 3rd party type covers that use Bluetooth like
https://www.amazon.com/Pinhen-Surface-Bluetooth-Detachable-Removable/dp/B01M3RLDFS
(one of these is for SP4, the others are for Surface 3). I have no firsthand
experience with these but Amazon has a good return policy.