Dofmap[icell] and links(icell) return different local connectivities in parallel

The geometry and topology dofmap does not necessarily use the same ghost ordering.

You need to use the function dolfinx.mesh.entities_to_geometry to map vertices to geoemtry nodes. See for instance

1 Like