Hi all.. anyone facing this issue can try the below steps that support team shared with me. I tried the below and I'm no more facing this automatic speaker on issues during calls.
Step 1: Go to settings>> apps and notification>>phone>>app info>>storage>>clear cache>>force stop>>done
Step 2: Settings>>system>>reset>>reset app preferences>>reset apps (u will not loose any app data though)
Step 3: Force restart the device by pressing power button and volume up key for 20 seconds
After doing this your issue must be fixed :)