This looks to be part of the Samsung Phone app by default and doesn't look to be something you can change.
The thread here recommends using an app to do so for speaker calls: https://us.community.samsung.com/t5/Galaxy-S9/Screen-goes-dark-on-phone-calls-in-speakerphone-mode/t...
"Think globally, act locally."
Give me a like ❤️ to let me know your appreciation for this post.
Please click ✅ "Accept as Solution" if this reply solved your issue or is the best answer.
(In the mobile app click the 3 dots next to this post to see that option.)