MSImmutableLayerAncestry has been renamed to
SketchModel.MSImmutableLayerAncestry in Sketch 66. Unfortunately CocoaScript doesn't seem to support such class names, so I'd avoid referencing this class directly.
As a simple workaround, use
ancestry() method on a layer itself:
Another possible workaround would be to create a reference to
let cls = NSClassFromString("SketchModel.MSImmutableLayerAncestry")
let ancestry = cls.alloc().initWithMutableLayer(this.artboard)