Internal boundaries with gmsh mesh and legacy fenics

For internal boundaries, you need to use the dS measure.
See for instance How to integrate on the surface of a subdomain (without making the surface its own subdomain) - #2 by dokken

Note that an internal facet integral needs a restriction to a given side, see: