Isn't that more due to the Bluetooth hardware used and implementation on the OS side? On macOS I never had flakyness with Bluetooth keyboards but on Windows my experience was significantly worse.
On Macos, first party peripherals have of course pretty good connectivity (is it even straight Bluetooth?) but it's not perfect either, and third party ones have a tougher time.
I wondered how much it was just me, apparently we were dozens: https://www.reddit.com/r/MacOS/comments/17659mx/sonoma_bluet...