https://jsdokken.com/dolfinx-tutorial/chapter1/membrane_code.html?highlight=gmsh#interfacing-with-gmsh-in-dolfinx
and Defining subdomains for different materials — FEniCSx tutorial
are two of many examples using external meshes.
This is related to how you have installed h5py. See for instance Importing mesh gives error - #8 by dokken
For final question about meshfunctions, see the demos ive linked to earlier in this post