Can you post a screenshot of your timeline showing the few seconds before and after one of the glitches? It seems to me that you're using a Glow transition (or something similar), but you say you're using a "layer." A timeline screenshot may clear up my confusion.
Also, you don't mention what output profile you're producing to. "4K" is a resolution, and there are several different pixel sizes, along with different encoding options that can be used. The full spec would be helpful, as would trying to produce without using the hardware (CPU only, don't use the GPU).
Finally, changing the type of transition may have an impact. Please try any or all of the suggestions and let us know what happens.
YouTube/optodata
DS365 | Win11 Pro | Ryzen 9 3950X | RTX 4070 Ti | 32GB RAM | 10TB SSDs | 5K+4K HDR monitors
Canon Vixia GX10 (4K 60p) | HF G30 (HD 60p) | Yi Action+ 4K | 360Fly 4K 360°