Some generative modifiers remove the `CD_MDEFORMVERT` custom layer. So make sure it exists in the mesh.