Which group is the problem group ? They differ in nesting level and whether the outer group or the internal faces are assigned a material or not.
If you had painted them each a different color it would be a better test, IMO.
Also, the code you posted is not a complete working code snippet. It does not for example assign gray color to any faces or groups, yet there are groups assigned a gray color (even though the faces within are painted green. NOTE: SketchUp uses face color to override group color in its display engine.)
I also notice in the model that some faces have material assigned to both the front and back sides. Others only one side. Switching to monochrome style it looks like all the faces are properly front-side-out.
Also … what version was the SKP file made with?
What version of the C API are you using ?