We found that CompoundPath have a bug in every version of Illustrator, even the last one and apparently it was found by others before us but I did not find any ticket about it so here it is :
I attached the file with a working case and the compound path bug (LEFT object = BUG | RIGHT object = WORKING).
Reference to other people writing about it :
The only problem I think you may run into is the quirky way Illustrator allows Groups to be inside CompoundPaths. Crazy, right, because CompoundPathItem doesn't have a GroupItems or PageItems property, so you can't get them out using the above method. In fact, it may get stuck in an infinite loop if there's one like that!
Normally, creating a group of two paths wouldn't even be possible in Illustrator.
But if you create a group of one path, select this group and an other path, make a compoundPath of this selection, you get a group inside a compoundPath.
A Compound Path Issue
Some scripts don't work for some part of compound paths. When this occurs, please select part of the compound path or release the compound path and select them, then run script again. I still have not figured out how to get properties from grouped paths inside a compound path.
Yea , this is one of my all-time favorites. You can get rid of this by using Flatten Transparency to "squish" all the objects into their rightful form, but they definitely should address it.