Default Screen won't stay on

Nexus 5, stock firmware not rooted and otherwise untouched. When trying to screen unlock the phone, it immediately returned to the lock screen almost as if it didn't unlock.

I found that if I power cycled the phone, I had around 20 seconds of usage before the same behaviour started again and I could keep doing this process.

I tried factory reset, and found that the screen worked perfectly for bootup and would work continually until any button was pressed - then the same 'screen switching off issue'. I could get a flicker of what was on the screen, by pressing the power button - but then it quickly gracefully went off.

The screen itself appears to be functional, and no odd pixels. Booting (and using) the bootloader / recovery works exactly as expected, without the screen turning off - for an unlimited amount of time.

I then tried flashing Cyanogenmod, but gave the identical result. Now reverted back to stock.

Any ideas?

Thanks