Combining the mask with anything requires special care IIRC, due to the order in which they’re in. MaskBlock and CategoryBlock weren’t designed to be in tangent. I attempted combining mask with bounding boxes which led to something similar. See the short discussion here:
What I can tell you is the order in which you pass the blocks is extremely important. So I’d start with simply reversing it (CategoryBlock then MaskBlock)