Run the Surface Diagnostic Tool.
Settings → Accessibility → Keyboard → Filter Keys = OFF
Go to Windows Update → Advanced options → Optional updates
Install everything related to:
Surface firmware
Keyboard / HID drivers
Boot into UEFI (Volume Up + Power)
Lag in UEFI → hardware issue (very likely)
Smooth in UEFI → Windows issue