Apple - Bluetooth headphones disconnect a few seconds after connecting on macOS
Try resetting the Bluetooth module.
Shift-Option click the BT menu bar item > Debug > Reset the Bluetooth module.
I also had no success with the other answers mentioned here. Found this suggestion on Reddit to kill the coreaudiod
process and it finally solved the problem without having to restart my computer.
I found that Bluetooth actually works for all devices but for the audio ones.
Rebooting the Bluetooth module didn't do anything, but killing coreaudiod
solved my problem for good.
sudo kill -9 `ps ax | grep 'coreaudiod' | grep -v grep | awk '{print $1}'`