Unable to set aptX codec on High Sierra
Turns out most of the issue is due to mac books having a weak bluetooth chip.  In order to free some bandwidth I have used wireless receivers for mouse and keyboard rather than connecting to laptop directly. Now the only device connected to my laptop via Bluetooth are the headphones.
For users of Logitech, the Unifying receiver operates on the frequency similar to that of the USB 3.0 so mouse movements where delayed, sometimes quite a lot. Not having a dedicated port for USB 2.0 only I used a MALE/FEMALE USB extender which is plugged to the USB hub so that the Unifying receiver does not sit close to the USB 3.0 cables.
This has pretty much fixed the Bluetooth issue. Though sometimes when reconnecting headphones appear on the list of devices but not on the list of audio outputs.
To fix that:

kill bluetoothd process from the activity monitor or run sudo launchctl stop com.apple.bluetoothd
followed by sudo launchctl start com.apple.bluetoothd (though this is done automatically after some time)

Few times I'm pretty sure I have had some sort of interference between phone and mac fighting for access, turning off Bluetooth on my phone stopped mac connection from cutting out so I tend to keep it off too.