Viewport turns blue or flicker

Hi guys,
I am trying to create a video from a 3D scan I have imported in Unreal engine 5 but when I start rendering the frames (in jpeg) the viewport (which shows the selected camera) turns blue and flickers between the normal color and this blue tint. Sometimes also I get some weird artifacts on the right side of the screen. I tried to disable antialiasing but this doesn’t fix the problem. I also tried 3-4 different Nvidia drivers but I still get the same problem. My GPU is the Nvidia RTX 3090 and the cpu is the AMD ryzen 5950x. Does anyone know how to fix this problem?