You've posted in the s9 / s9+ boards but mention the s8 in your post.
Can you confirm which model you have please ?
You mention “ secret menu ” is this via dialing *#0*# in your phone app ? What happens when you do the tests in there if this is the case.
Have you tried the diagnostic tool in your Samsung Members App.
May I also assume no in-transit packaging or case maybe causing this.
If everything you've tried is not working then due to how long you've owned the phone I'd suggest to have it replaced by the business you purchased it from within any relevant Cooling Off Period.
I wish you all the best with this.
Daily Driver > Samsung Galaxy s²² Ultra 256Gb in Phantom Black.
The advice I offer is my own and does not represent Samsung’s position.
I have no affiliation with Samsung.