My XR microphone worked for phonecalls and voice memos. But not for taking videos as there would be a lot of hiss and patchy underwater-like sound recording with silences and gaps.
After doing all the recommended suggestions including toggling of various sound options and even doing a reset that caused the loss of all my preset wifi passwords and customised settings, I finally solved the problem.
There is actually a 3rd microphone near the rear-facing camera that was covered by the rear phone protector. Cutting off a corner of it to unblock the microphone hole did the trick. All that unnecessary sweat wasted. Hopefully this helps for some of you.