On some occasions it is very useful to stream audio and record what's going on around you, using Voice recorder, at the same at the same time. This worked on my Galaxy S9. On my Galaxy S21 Plus once the voice recorder starts recording whatever audio is playing get shut off. On the s9, while recording external audio, whatever was streaming was not being recorded. Oh yeah, I'm doing this all on my Bluetooth device. I believe the conflict is that the microphone that's used is on the Bluetooth device.
I have never attempted doing what you are, but you can try going into your Bluetooth settings and next to the Bluetooth device you are using, select setings, then if it's turned on, turn off the option for calls. Leaving only the audio option turned on. Doing that might keep the microphone from being available on your Bluetooth device and allow you to do what you are wanting to. But like useryOTEywbJ9x said, it could be a security measure that was implemented on devices that came out after the S9.