Does this app work on your phone?
Auto Speaker
Or, maybe Auto-Hands-Free
Use Good Look on Galaxy Store. If it's not available in your country use Nice Lock and go to Task Changer. There you can choose to change it between six types.
It has many other uses. Search for Good Lock on YouTube and you'll find many videos on it.
I found a solution. Nacho Notch — Notch Hider in the Play Store duplicates the function of the setting that Samsung seems to have removed.