The vertex group indices stored in the weights need to be accounted for when the vertex group list on the mesh changes.