I added this line to the end of my render function and that seems to have solved my rendering issues on the line layer above - I believe it is reseting MapLibre's own stencil buffer before it begins to draw the next layer.
this.map?.painter.clearStencil();