I figured it out for anyone who stumbles across this post:
In my mask buffer allocation, I have to add a depth buffer size, like so:
this.maskBuffer = RTHandles.Alloc(
Vector2.one,
TextureXR.slices,
dimension: TextureDimension.Tex2D,
colorFormat: GraphicsFormat.R16G16B16A16_SFloat,
useDynamicScale: true,
name: "MaskBuffer",
depthBufferBits: DepthBits.Depth8 // Add here
);
From what I understand, the engine expects a depth map because I didn't specify one? Maybe somebody could help me understand a little bit more behind it but I hope this helps somebody!
Another note:
The object that I was trying to apply the mask to has a custom Shader Graph shader that I created, which has a specific ShaderTagId that you must add to the shader tag ids list that you can see in the original question.
The way you find that for shader graph is by clicking on the shader and clicking "View Generated Shader" in the inspector and finding the line that says "LightMode" = "<Shader Tag ID name>". In my case, the ID was "ShadowCaster", which I did not have added to the original array, but now that I added it, everything works fine.