I've come up with what is hopefully a better solution. Use the app here. Install the app on both devices. There are many similar apps to this so if this one doesn't work perhaps try another one. The app listed works over Bluetooth rather than WiFi. I hope this is OK and it should avoid latency. I'm not sure why I didn't make the link in my head that what you needed was a voice communication app. The old solution is below:
There certainly seems to be a gap in the market here because I can't see why this would be impossible (actually, thinking about it, capturing all device audio might be an issue [although you would only need to capture audio input which wouldn't be...]). I have a solution but it's a rather hacky one and will require root, I'm afraid.
NOTE: I haven't used any of these apps myself. Be careful when installing unknown applications.
Host a WiFi hotspot on one device and join the hotspot on the other. Make sure to turn off data before doing this. This way, the devices won't have an Internet connection but they will have a network connection.
Install AirAudio on the device that you wish to stream from.
Install Microphone on the device that you wish to stream from (this app may have some latency but hopefully not).
Install UPnPlay on the device that you wish to stream to.
Turn on the Microphone application so it starts recording everything and then set AirAudio to stream all device audio over DLNA and then use UPnPlay on the other device to recieve this stream.
I don't think this will work well in practice but it may be worth a try.
Hope this solves your issue.
Answer from LJD200 on Stack Exchangewi fi - How to use two Android smartphones as lavalier microphone transmitter and receiver? - Android Enthusiasts Stack Exchange
[question] What are some good mic recommendations for an android phone? Are there any mics that don't need an adapter?
Wireless Lav/Microphone System for Android - Rode Wireless Pro?
How to Use Your Android as a Wireless Microphone for Your Computer
Can a Wireless Micro be used with a camera?
Yes, but you will need the add-on Wireless Micro Camera Receiver. Alternatively, you can use the dedicated Wireless Micro Camera Kit.
Is the Wireless Micro compatible with third-party camera applications?
Can the Wireless Micro be used with a computer?
Videos
I'm a realtor and want a wireless microphone system to use with my Samsung S25 Ultra when recording social media content. I want it to be compatible with external lavalier microphone for visual purposes. The system I was looking at was the Rode Wireless Pro. If I do not plan on using the built in microphone, do I need to get the Pro? Could I go with something less expensive?