Get bluetooth keyboard working identically to built-in keyboard
Troubleshooting is a process of elimination and often requires patience.

As a starting point, I'd try to reset both the macOS Bluetooth Device List and Bluetooth Controller. 

IMPORTANT: This will reset all connected Bluetooth devices, including any wireless keyboard or mouse, so they will need to be reconnected.

Before commencing, you will need to have the Bluetooth icon showing in the menu bar. If it is not there, open System Preferences > Bluetooth and enable the option Show Bluetooth in Menu Bar.

Resetting the macOS Bluetooth Device List and Bluetooth Controller

Follow these steps:


Hold down both the Shift and Option keys and at the same time and click on the Bluetooth icon in the menu bar. Once the menu is showing, release the keys.     
From the Bluetooth menu, choose Debug > Remove All Devices
Hold down both the Shift and Option keys again and at the same time click on the Bluetooth icon in the menu bar. 
From the Bluetooth menu,  choose Debug > Reset the Bluetooth Module
Restart your Mac
Setup your keyboard again


After doing the above, test your keyboard for a while to determine if it's now working better.

If it's not, there are other things we can try/test for on the MBP side of things. However, before doing that, the next step should be confirming the keyboard itself is okay. If possible, test the keyboard with another computer and confirm it's working okay with that. If it isn't, then replace your keyboard batteries of make sure they're fully charged and test again.

Let me know how you go up to this point and if necessary we'll proceed further.