The problem is not the presence of the scrollbar per se: it happens only when the vertical scrollbar appears and the window is not reduced more than 5/10mm from such point.
For that reason it looks random.
The workaround is simply changing the heigh of the window of +/- 1cm in hight.
Caja 1.22.3 (on Debian Buster)
Same problem.
The problem is not the presence of the scrollbar per se: it happens only when the vertical scrollbar appears and the window is not reduced more than 5/10mm from such point.
For that reason it looks random.
The workaround is simply changing the heigh of the window of +/- 1cm in hight.