Stencil shadow is not drawn if a mesh, or multiple meshes with the same entity and shader, have more than 500 vertexes. The issue is caused by storing the projected positions in the tess vertex buffer. Use a new array instead.
Manually changing cull state can cause later GL_Cull calls to not change the cull state.