That’s an issue of JavaScript accessing all properties as the “preferred import destination” property might use the group selector. One workaround is to change the preferences, another one to use AppleScript.
Yeah, AppleScript doesn’t really float my boat, but I do it through gritted teeth when necessary. I’m not really a JavaScript convert, either, but it’s closer to home for me.
BTW - Christian’s comment was super helpful here – it’s simply that it’s grabbing the incomingGroup property, so that accessing other properties directly won’t trigger the same issue.