EDIT: I managed to solve this issue, and it was one of the most curious troubleshooting I ever had to do. TL;DR: A magnet (for the hall sensor) was interfering with the screen's inverter board.
I have an old HP G61 which I left for my older kid to learn some coding. Just yesterday he was using the PC in the morning without any issues. When he returned later afternoon, the PC was acting weird.
Soon after booting/rebooting, the screen would go black after approximately 5 seconds. This isn't a Windows issue (or any other OS for that matter). If I go to the BIOS menu, or boot device selection, or if I boot onto another OS from a thumb drive, the same issue would happen.
The screen might be black but the PC is functional. CAPS/NUM LOCKs can be switched on/off, and PC would make sounds when certain keys are pressed. I can also see the drive read/write activity LED blinking as Windows boots up.
Curiously, if I perform a warm reboot via CTRL+ALT+DEL, the screen would come back during the reboot, but again after a few seconds it would go black.
If I connected the laptop to an external screen via HDMI it works just fine. Curiously, every time I change the screen projection on Windows (duplicate, extend, etc) the screen on the laptop would again show for a few seconds, and then it would go black.