Some of the prior work in this area is based on stationary devices and some is based on pre-V4 Bluetooth. A lot of it is focussed more on the privacy aspects that the rangefinding. Here's a few things that may be of interest:
- Google/Apple Exposure Notification v1.1 protocol - mentions tx power which suggests the underlying basis is a TX vs RX (RSSI) power comparison with no detail on how that's refined. I'm not sure how real tx power is standardised across devices, the spec. here isn't detailed either. Exposure Notification has a UUID of 0xFD6F which can be a useful search term to find the more technical articles written about this.
- Digi-Key: Use Bluetooth 5.1-Enabled Platforms for Precise Asset Tracking and Indoor Positioning - Part 1 - this is all very new (V5 not V4) and I'm not sure if this is of great use for a simple two device rangefinding case.
- Shu Liu, Yingxin Jiang, Aaron Striegel: Face-to-Face Proximity Estimation Using Bluetooth On Smartphones (2014)
- @danhalbert mentioned that some of the latest nRF chips like nRF52833 support DF: Nordic SemiCondutors: Bluetooth Direction Finding.
- Adafruit Learn: CircuitPython BLE Advertising Beacons
I had a play with the BLE range between two CPBs when I first got them. My walking across the room test showed about a 5m range. That was equivalent to 80cm when one CPB was placed behind a flat panel monitor and the other was cupped between hands. I was about to experiment with a bit of old skool DF by mounting and wiggling one on a servo but I had an accident with a CPX test so didn't pursue that!
There may also be work in this area for clandestine Uyghur proximity/tracking. I've not found anything yet than mentions BLE though.