UWB is exactly what you are looking for, and support for it is built into Apple phones. It's designed to measure distance and approximate direction. Range of about 40 meters and an accuracy of 10cm. Standard off the shelf chips.
This is the same tech that is in AirTags, but if you made your own beacon, you could have much control over power output.
Apple documentation: https://developer.apple.com/nearby-interaction/
Here's one chip - there are others though: https://www.qorvo.com/products/p/DWM1000
Forum discussion on ranging: https://forum.qorvo.com/t/dwm3000evb-max-range/11906/5