When filtering the render using view layer, could be possible the mask is NULL and just need to be ignored.