Without any keyframes on or video events beginning or ending at one particular frame, Vegas is arbitrarily changing the Rays effect by making it noticeably brighter at and after that frame than it was before.
Frame 95:

Frame 96:

This problem only happens when I render in 4k (screenshot resolution was reduced). 1080 Full HD doesn't cause the problem for some reason. I need my video in 4k though.
I do have Computer to Studio RBG enabled on levels.
Software: Vegas Pro 17.0
Processor: Intel Core i7 8th Gen
Graphics Card: Intel UHD Graphics 620
Operating System: Windows 10