I have same exact problem on my s8+. Sent it back to the factory, they kept it for 10 days and returned it wih “no trouble found” ! Either incompetent or more interested in clearing the ticket than fixing it. I told them it acted just exactly as though the battery was totally drained, which to me said it was a power problem — either bad battery or power circuitry.
BUT, don’t despair! I accidently discovered that putting the phone on ice or in the freezer for just 2 minutes restored complete functionality. Turned it back on & just had to input password. Voila! Obviously a battery overheating problem, even though phone was not hot when it blacked out. (NO! Lithium batteries don’t have heat problems!)