Welcome to the Community!
The same has happened to me, its very often, if im using facebook the same thing pops up, and im always indoor when it happens, and happens morr at night which there is no possible way it is recieving direct sun light cause its night time and i am indoor
Might I ask a few odd questions:
Can you look at what apps are open (And please post a screenshot):
Settings -> Device Maintanance -> Battery. -> Battery Usage
(The idea behind that is if an app generates a lot of heat, it also uses a lot of energy to generate the heat, which should be visible under battery usage ).
I'm extremely interested in the apps that use too much battery Perhaps one of them is sneaky and for example mines cryptocurrency in the background (You never know )
After that I highly recommend to restart your phone after the screenshot is made, this closes most background apps.
Yes my S9 plus continually overheats even just talking on it it nearly burns your ears, third phone after them sending refurbished replacements and exactly the same issue. Very very very dissatisfied after being loyal to Samsung for a long time. When out of contract I will be looking elsewhere .
I bought S9 7 days ago it is getting so heated that I couldn't even hold it the back is getting so heated all troubleshooting steps are done by me still it is getting heated