Just bought a brand new Galaxy s9 today. I have the screen timeout set to 10 mins but the screen dims then turns off in 5 seconds. Ive checked ALL my settings and nothing fixed it and even factory reset it.
My phone is set to 2 minutes as to preserve battery but that said it'll stay on and log for those two minutes.
I can't see this being a rogue app causing this but none of the less it could be beneficial to put the phone in safe mode which turns off all your downloaded apps and leaves the stock ones alone which can help to determine if an app is causing this situation.
If it continues and as you say all your phones settings are correct then I'd suggest to visit a Samsung Service Centre or Samsung Experience Store for support or ask for it to be checked and or replaced from the business you sourced the phone from.