I tried Clean flash but, after some time while using Stable rom the problem still persists and it has too many problems I don't know why.
so I tried to clean flash weekly rom again. still the same problem, but then I tried to disable "Ok, Google!" both "Phone" and "Messenger" Works like a charm.
No problem with the Loudspeaker even when turning it on or off, even using headset., also with the messenger Other party can hear me.
so all this time the culprit is the Google Assistant.
Thanks mate.