Seems that a lot of people complain about this bug/glitch. It mostly happens with this device, specific to some carrier like s5 t mobile etc. Mostly what people face is flickering with a green/yellow nuance that covers at least half of the screen, and that happens when you set screen brightness on minimum. Some other ( like me ) also get the flickering while turning the screen on or off. So I started doing some searches over the web, and tried all the 'fixes' possible. Sadly to me nothing worked. Some of these 'fixes' are :
Turning off auto brightness.
Turning off adaptive display.
Turning off screen overlay
The fixes were suggested to me by the geek squad phone repair team. After turning off the screen overlay the issue was fixed. And it never came back again.