I agree SketchUp shouldn’t BugSplat, but all you can do is file a bug report and work around the problem.
You could first create a Group from the Instance:
grp = entities.add_group(instance)
Then set all the Group’s attributes/properties, then explode the Instance afterwards.
Alternatively if you want to keep your existing code, it is better to explicitly include what you want instead of excluding what you do not:
entarr = entarr.grep(Sketchup::Drawingelement)