Produces errors in console. It seems as if multiplication (vertexLocal) transforms the point not from world coordinates but from parent's coordinates. I assumed the two transformations were supposed to be identical. Aren't they?

Since worldToLocalMatrix is a 4x4 matrix and vertex is only a Vector3 when the two are multiplied together vertex is automatically converted to a Vector4 with a 4th component of 0.

So

transform.worldToLocalMatrix * vertex

Is the same as

transform.worldToLocalMatrix * new Vector4(vertex.x, vertex.y, vertex.z, 0)

But when that forth component is 0 the multiplication is ignoring the position of the matrix, which is why you see the wrong result.