Custom Depth Stencil index isnt respected.

I have a problem, I created a post processing material to see objects through the wall, so I set the material in position 3 of the post processing volume, the meshes that I don’t want to see through the wall I left in Custom Stencil to 1, which are a affected by another material from position 1, but post processing material ID at 3 is affecting meshes with stancil index 1. How do I filter Post Processing Material by Stencil ID on meshes?
Captura de tela 2023-03-03 201621

I found it by enabling Stencil Test, constraining the ID to equal and setting the ID value which I used in the mesh.