Now the scripts are ok.
You used Levels(16,1.0,235,16,235) command that does nothing
because the input levels range and and output levels range are the same. The value "235" only applies to that frame, check if the others frames are the same, finding a significant segmen with high "whites" spots.
On the other hand, if you adjusted the input levels with the procamp to stay inside 16-235 level, what you see is its consequence, and then the levels do no need to be adjusted.