My AirPods 2nd gen (model A2031 running latest firmware 6A321) have started erratically not connecting to my iPhone 12 Pro.
Both phone and AirPods are on latest OS & firmware.
The scenario is I'll put my AirPods in my ears and I hear the connection bong plus I see the notification saying AirPods have connected on my phone. When I go to play music (Apple music), the sound comes from the phone. If I go to the phone and select the AirPods on the AirPlay tab in Apple Music, I just get a spinning wheel. The only solution I've found so far is to restart my phone.
I've tried forgetting the AirPods on the phone and then setting up the Bluetooth connection again, but that didn't fix the immediate issue, so still needed to restart phone, and the problem still recurs.
I've not identified any specific action that causes the AirPods/Phone connection to break, and I've not seen any pattern. I can go days without an issue then sometimes it happens every day.
I've had the AirPods for 5 years, but sound and battery life is all still good for me, so not wanting to buy anything new at this point.