Nordic published a great blog in 2022: "Comparing range with Bluetooth Low Energy of the nRF21540 DK and the nRF52840 DK." It clearly explains the range capabilities of the nRF21540 DK and the nRF52840 DK, and also provides example code to test this yourself using nRF Connect SDK v1.8.0.
However, a lot has changed since then. Would it be possible to update the examples for the latest nRF Connect SDK v2.9.0?