I have a client who has some Styles they're still using from the pre-CS5 era which have "add arrowhead" appearance styles, but these no longer work in Illustrator CC 2015.3 (actually, existing paths are rendered correctly, they just can't duplicate/move/re-apply). The styles basically implement a solid path with an arrowhead, and an outline/border of a different color. This wasn't possible to replicate in Illustrator CC 2015.3 as arrowheads didn't align correctly, but we can replicate it in Illustrator CC 2017 by converting the path with arrowhead to an outline and duplicating it (solid filling one, and applying an outline stroke to the other).
It's a more involved process than just a style (their old style applied multiple strokes with multiple "add arrowhead" appearances, so it was implemented entirely as a style), but I believe it's scriptable.
I seem to reasonably be able to convert a selected path (with an arrowhead, in this case) to an outline as follows:
app.executeMenuCommand("Live Outline Stroke");
However, I can't seem to then be able to reliably duplicate that pathGroup to then apply different appearances to each. If I iterate over the pathItems in the newly-selected groupItem and duplicate as follows:
var newPath = aPath.duplicate(theGroup, ElementPlacement.PLACEATEND);
I end up with a copy of the originally-selected path (though I've verified it's a groupItem) with some apparently empty additional groupItems.
How are you iterating over the path items in your new group after the expansion? When expanded, a stroke with arrowheads produces one path item which is the line and two group items each of which contain one path which is the arrowhead triangle.