What is wrong with my mesh?

Using a slightly different conversion syntax, I can reproduce your domain with XDMF.

import meshio
import numpy as np


def create_mesh(mesh: meshio.Mesh, cell_type: str, data_name: str = "name_to_read",
                prune_z: bool = False):
    cells = mesh.get_cells_type(cell_type)
    cell_data = mesh.get_cell_data("gmsh:physical", cell_type)
    points = mesh.points[:, :2] if prune_z else mesh.points
    out_mesh = meshio.Mesh(points=points, cells={cell_type: cells}, cell_data={
                           data_name: [cell_data]})
    return out_mesh


# import and convert msh file to xdmf
msh = meshio.read('mesh.msh')
line_mesh = create_mesh(msh, "line", data_name="Boundary", prune_z=True)
meshio.write("mf.xdmf", line_mesh)
triangle_mesh = create_mesh(msh, "triangle", prune_z=True)
meshio.write("mesh.xdmf", triangle_mesh)

The issue is that you have tagged facets that are not actually in the mesh.
This can be shown by calling:

points_in_facets = np.unique(np.sort(msh.get_cells_type("line").reshape(-1)))
points_in_cells = np.sort(
    np.unique(msh.get_cells_type("triangle").reshape(-1)))
vertices_in_facets_not_cells = np.isin(
    points_in_facets, points_in_cells, invert=True)
print(msh.points[np.flatnonzero(vertices_in_facets_not_cells)])

All the vertices printed here are vertices that are found in your facet mesh, but not in your actual mesh.

The problem is probably how you duplicate points of your mesh. However, as I do not really use the GMSH geo format (I rather use the gmsh python API), I don’t know a workaround for your problem.