Hi there. That's EXACTLY the same issue I am having apart from the fact that my microphone is fine when recording a voice memo. Since the microphone works fine when recording through front/back camera, it has to be a software issue. After reading tons of posts, I have come to the conclusion that the issue is the software noise cancellation that Apple has introduced, and inconveniently enough prevents from being turned off on Apple 13 and further (if you have Apple 12 or earlier, you can still try to turn it off in Accessibility menu somewhere, some users have reported that this helps). Apple doesn't care and won't solve this. We are on our own. My "hotfix" is to answer inbound calls through my Apple Watch, which fortunately works fine when the voice is routed through the watch. For outbound calls, I just use headphones.
One workaround that sometimes works, and you can try, is to toggle microphone from standard mode to voice isolation mode or vice versa - when calling just pull up the control center and upper right corner you'll see a yellow tile with microphone. This sometimes works. Not always, but worth trying in an emergency situation when you really need to call someone on a street and don't have headphones / apple watch handy.
Good luck.