Nanite bug destroying my foliage meshes


I was tweaking the master material of my foliage when this happened. If I disable nanite the mesh looks fine, but when I enable it again the problem persists. Any ideas?