I found the reason which UI element is causing this in my application. It happens when I have a title bar items aligned right and the style is bsMenu. But I still can’t repeat this in your demo.
So, I ended up to fix this:
procedure CopyByMask32(R1, R2: TRect; const Bmp1, Bmp2: TBitmap; const CI: TCacheInfo; const MaskData: TsMaskData);
...
CacheBMP := Bmp.ScanLine[R1.Top + PosY + Y];
=>
CacheBMP := Bmp.ScanLine[Max(R1.Top + PosY + Y, 0)]; // Lasse