My phone also had the red button greyed out. Or sometimes it would be red but it never actually recorded anything when I clicked on it.
I was able to temporarily get it to work and apple wouldn't replace my phone under warranty so I had to send it to a mail-in shop that could fix this.
This article had some good suggestions like using bluetooth speakers.
fixstop.com/blog/iphone-7-speaker-grayed-out-and-microphone-not-working-solution/