It's not just the render view but it also renders in the final image as a mask. This does not happen in eevee, though. Both of the objects have a Principled BSDF material and the object which is acting as a mask DOES NOT have a holdout shader. I also tried going through some of the options in the object properties, but nothing changed.
Here's the blend file: