Different behaviour of a mesh coming from generate_mesh() resp. UnitSquareMesh()?

Gmsh creates triangles and tetrahedrons by default. Using recombine, see: Files · master · gmsh / gmsh · GitLab

The create mesh function is part of dolfinx not dolfin.

One is to save the mesh, while the other one is saving the facet data. To read it into dolfin, these needs to be separate.

You can load it in the same way as you load in mesh data. See for instance: Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio - #3 by dokken