My AirPods (1st gen) won't switch over to my MacBook Air (early 2015 running the latest Mojave) from my iPhone 8. When I click 'connect' the indicator just spins and nothing happens. Restarting resolves this, and my AirPods are then able to connect to my MacBook. Any ideas as to the cause of this? Are my AirPods perhaps faulty?
Apple has always these kind of bugs with their wireless (or even wired) platforms. You just need to force it to connect.
So you can go to sound settings of system preferences and force connect there.
Note that it could either fail because it may be in-use or disconnect from the other source that already connected and using it (Randomly but second option most of the times depends on what device requested new connection and what device is using it right now).
It always helps me and hope it helps you as well.