Call to gmsh/model/occ/fragment only returns highest dimensional resulting entities if tag >= 0 || !preserveNumbering
The returned outDimTags from calling gmsh/model/occ/fragments only includes the highest dimensional new shapes if tag > 0 or Geometry.OCCBooleanPreserveNumbering = 0, otherwise it includes all dimensional shapes. I think it is probably meant to always include all resulting entities.
This is due to the source code for OCC_Internals::booleanOperator (GModelIO_OCC.cpp) being as follows (I've used ellipsis to indicate irrelevant code to this discussion):
if(tag >= 0 || !preserveNumbering) { ... _multiBind(result, tag, outDimTags, true, true); ... } else { ... _multiBind(result, -1, outDimTags, false, true, true); ... }
I suspect both calls to _multiBind should have highestDimOnly = false, however it is only false in the else branch. I believe this is why the outDimTags only contains the highest dimensional entities in the (tag >= 0 || !preserveNumbering) branch. I'm not sure if this is intentional or not.