This issue is clearly due to defective parts or bad design choices. My Macbook Pro 2017 13'' with touch bar started showing this problem after two and a half years of usage. This thread here is huge and full of complaints by dozens of apple customers: https://www.ifixit.com/Answers/View/510833/Horizontal+lines+on+top+and+bottom+screen
Four months ago the problem started appearing and I tried to stop using the computer as soon as I could so it would not worsen. This is how it started:
Very subtle, huh?
After four months and some sessions were I couldn't stop using it (due to important work and virtual meeting I was participating), the problem now have worsen. The more I keep using it, the more lines start going dark and, eventually, totally desynchronizing and displaying only white. This is how it looks like now (if I keep using it some time - one or two hours - after the first black lines appear):
Quiet ugly, huh? These white lines can't display the screen content properly anymore. Luckily, until now it all goes back to normal after leaving it sleeping for 3-4 hours (it is not necessary to turn it down). If I try to use it sooner, these white lines are still somewhat present, but the screen can partly update the pixels. Also, the faster I start using it again, the faster the lines appear again. When I leave it sleeping for enough time, I can use it for some 1-4 hours before seeing the first lines (depends on GPU usage, I guess).
I have noted that if I use it over a support that allow air to circulate below it the problem takes longer to appear. But it will always appear after long usage, even if you are just watching videos. Another thing someone said in the thread above is that if you put ice behind the notebook screen (in the bottom, were the lines appear), they disappear almost instantly. It does, I tried it. But only to reappear seconds later after removing the ice. So it does look like it is a thermal issue.
People have pointed out that this is a design flaw, that the TCON board that is responsible for synchronization and refresh of the horizontal lines in the screen (as I understood) was placed just over the air exhauster, so the hot air is probably overheating the board and causing this issue. I'm not sure if this explain the whole problem. Right now, if I put ice behind my screen the black lines disappear but the first lines from bottom screen still show strange behavior, like mixing the current visual content with the last content it have been displaying. So it looks like it is not just temperature. I MUST wait several hours before the screen goes back to normal. Trying to make the whole computer cool faster does not solve the problem, the white lines burned with the last content keep showing and the black lines come back way faster if you do not wait enough time.
I did not take the Macbook to Apple Service, since we are in the middle of a pandemic, but I intend to do so. I hope they will consider this what it really is - a factory/design problem - and give me warranty exception and find out a way to fix it so it won't appear even if I use my Macbook at maximum performance. By the amount of people complaining, I do think Apple should start a Repair Service Program for this issue. I'm not even sure if I would pay for a replacement, since some people have described that the problem appeared again some weeks later after replacing the screen.
I have bought a PROFESSIONAL computer with max specs so I could work and program without performance issues. It has been incredibly frustrating to find out that my computer can't compile a code, install code packages or even play a movie without showing these ugly lines that keep reminding me I must turn it down and stop working or having fun. Not to even mention the keyboard keys that are always failing (at least there is a service program for this). I'm "lucky" I still have my old 2010 Mackbook Pro that I can use to - kind of - do the work I need when my 2017 'Monster' Macbook needs to sleep. If it wasn't for it, I would be forced to keep using it and I'm not sure what can happen if I ignore the white lines of death when they appear.