Hardware is my guess
My guess is it is hardware. I have seen something like this with a bad video cable connection. Just a guess, though.
Any time you suspect it is a different ROM and you are about to send it back, try to return your Nexus to stock and see if it goes away.