Now that you're reporting this, I've had a few (very few) situations over the last few weeks which were slightly similar, but not as severe. Screen going black while in use, needing a press of the power button to come on again, or screen becoming touch-insensitive until switched off and on again with the power button, and there might have been one occasion or so in which such a situation needed a reboot, too. I'm on LineageOS 18.1, and for me this somehow rather felt more like software rather than hardware, but that's just an impression.