Check and see how many Bluetooth devices are connected to your Mac. If 5 or more Bluetooth devices are connected to your Mac at the same time, the problem you described may arise. I limit the number of simultaneously connected Bluetooth devices to be smaller than 5.
As other people have suggested, a low battery level also causes such a problem.