Using custom stencil in 4.18

I am trying to get an object highlight material working. I can get it going as a single color, but as soon as I try to use a scene texture: Custom stencil to set colors the outline stops rendering. Any help would be appreciated.