By definition and description bundle guarantees to have only internal refs in the resulting output, however it does a bit of internal refs optimization/simplification on its way.
e.g. in case of internal ref 1 -> internal ref 2 -> definition section having $ref: <internal ref 1> becomes $ref: <internal ref 2>, which sometimes complicates cases, where changes are needed for section with internal ref 2.
It would be nice to have an option to opt-out and not optimize internal refs, thus having a pure behavior of resolving external refs only.