Export results in invalid geometry

Hi,

Im having some trouble exporting certain geometry, through either:

RhinoDoc.WriteFile
RhinoApp.RunScript($“_-Export "{exportPath}" _Enter”, false)

it curiously does work when using the export functionality through the UI.
See attached files for the resulting exports.
I can see that “something” is exported, because using ctrl-A in both files selects objects,
but in the script export none is displayed.

Any help is appreciated.

kind regards,

Mick

CE-005345-0003.3dm (2.4 MB)
CE-005345-0003-manual.3dm (3.3 MB)