just patch inputs and outputs to audacity (or your recording software of choice). for pipewire theres helvum[0] or qpwgraph[1]. for JACK there's Catia[2].
If you have a headphone jack and a splitter that could work. I do not know of any "two sided" Bluetooth devices that could sit between a phone and headset.
[0]: https://gitlab.freedesktop.org/pipewire/helvum
[1]: https://gitlab.freedesktop.org/rncbc/qpwgraph
[2]: https://kx.studio/Applications:Catia