AirPods won't switch to MacBook
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.



or if you already have the indicator in the status bar , you can option+click on that and force connect from 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.