I cannot reproduce your error with:
docker run -ti -v $(pwd):/fenics/shared -w /fenics/shared --rm --shm-size=512m dolfinx/dolfinx:stable
and
from mpi4py import MPI
from dolfinx.io.gmshio import read_from_msh
mesh, ct, ft = read_from_msh("mesh2.msh", MPI.COMM_WORLD, 0)
mpirun -n 16 python3 mwe123.py
Info : Reading 'mesh2.msh'...
Info : 422 entities
Info : 174656 nodes
Info : 169404 elements
Info : Done reading 'mesh2.msh'
Also, your script did not show how you converted the msh
file to xdmf
.