SaveScreenshot non-deterministically broken

Hi everyone,
I’m using paraview from python for scripting and the output of simple.SaveScreenshot is sometimes broken, as can be seen from this image:

Unfortunately, this happens non-deterministically and without any warning. If I run my script two or three times, it will give the correct output eventually. It happens when saving png and jpg. I’d obviously like to fix this, so that the script produces a correct image reliably…

Any help or search direction is appreciated, thanks in advance!


It looks like scaling the layout before saving the screenshot fixed it. Is this possible?