PLEASE EVERYONE!
This is a known issue and Apple is working on providing a software update to fix the issue. Just wait. No need to keep replacing your units. If you are unhappy, then please just go return the phone and get your money$$ back and buy something else!
A solution is coming!
Changing phones will not guarantee you will not have the issue reappear.
A temporary solution that is working for some is to temporary switch on the Speaker and then you can go back to the normal speaker. Or always use the Speaker or use EarPods, AirPods, Bluetooth headsets or any wired headset.
File a feedback to Apple and know you will be covered if something does not work out via the Apple promised repair solution.
Please just wait!
Hope this Helps, Greg