I'm having a similar problem from the past week on my nexus 5. it's getting worse as more days go by.
I'm not using any case for the phone. I have tried factory resetting the phone which has not helped.
the phone keeps locking and timing out every 10 seconds or so. I have disabled the lock screen too, but it makes no difference.
I've uploaded a small video of this happening on Youtube. It is actually much worse than seen in the video.
I cannot post the link as I'm a new user.the video is titled "Nexus 5 lock screen loop". It's a 30 second video.
Hope you guys have a solution. Thanks in advance.