Hi,
you must include in your code the case where the GeometryObject is of type GeometryInstance (in addition to the Solid type).
GeometryObject
GeometryInstance
Solid
Example here