When rendering out videos, with many layers, png sequences and imported photos/videos as a .mov with alpha channel, flickering lines of pixels would appear and disappear throughout the final output.
I am using an older version of After Effects: 17.1.0, on a Mac (High Sierra, 10.13.6).
It seemed to be inconsistent when these glitches would appear. I rendered out several of these sequences with no issue, until a certain moment when it was appearing on every subsequent render.
The solution seemed to be to clear my cache before peforming each render.
I used Edit > Purge > All Memory and Disc Cache.
A couple times this didn't work, but restarting my computer, clearing the cache again, then rendering seemed to solve it.
Hope this can help someone else in the future!