I am having the same issue and it started yesterday. My airpod pros disconnected and disappeared from my list of bluetooth devices. When I put them back in their case and re-opened it said "Not Your AirPod Pros" and had me re-do setup. I did the setup and they connected for a short time, then disconnected and disappeared again. This has happened a dozen times... sometimes they are connected for 30 seconds, sometimes 5 minutes.
This is only happening on my iPhone. They work fine on my MacBook. I have restarted the iPhone. I have Erased Network Settings. I have turned BlueTooth off and on. I have used "Forget Device" when the Airpods were connected and tried to re-pair them... all with the same result. They pair (usually they have even saved the Airpods device name).... then they disconnect and unpair.
I even purchased brand new Airpod Pros today as I thought it might be an issue with my old ones. The new ones are doing the exact same thing. So it is isolated to my phone - and is happening on multiple Airpod Pro devices.
My Iphone is an 12 Pro Max on version 15.4.1
The newest pair of airpods I've been trying are model A2084 and firmware 4C165