Sorry, I now read the example to the end and saw persistent_id_path → String.
I cannot reproduce your example for nested groups. Are you sure your selections are nested?
I can reproduce the example. It is necessary before assigning variable “c” to go into edit mode on the group and select the component inside first.
As a side note, the group is non-standard, in that it contains a single entity, the component. I don’t know how to do that with the built-in tool set. (Clicking a single geometry object, and then right clicking it, results in a right click menu that does not include a group menu option). I suspect that the group was created with Ruby code.
I started from scratch with a new Sketchup drawing and drew a single rectangle and made it into a component. I then drew a single edge on top of the rectangle, which was not part of the component. After selecting both edge and component objects, I was able to group them as an outer group. I still encountered the same results. InstancePath is new for Sketchup 2017, and I’m not familiar with it.
I thought that perhaps being in edit mode resulted in a shortened path and active path has to be accounted for. I exited edit mode and still encountered the same results.