I’ve had the same thing happen to me on an iphone 7. In my case it turned out the screen was faulty. and replacing it caused the phone to return to normal function.
open