I have a temperory idea: as I know, if the sleep time of keyboard is long (several minutes) the disconnection issue happen. so can some one write a shell script to watch the keyboard connection state and as soon as disccoent, force to reconnect it with MAC address?!
I have same annoying issue :( It disconnect randomly or on screen-lock or keyboard awake...
After every disconnect, It change it's Bluetooth-MAC address so I have to re-pair it with bluez v5.60
#bluetoothctl devices
Device E7:5B:CE:75:3F:97 Surface Keyboard
Device E7:5B:CE:72:3F:97 Surface...