Need to modernize my scripting, this bpy based script from 2.77 doesn't run in 2.92 so I can't post my main question yet
The answer to your question may be found in this Q&amp;A. Since 2.8, it seems that objects should be linked to collections instead of scenes.
old:
bpy.context.scene.objects.link(ob)

new:
bpy.context.scene.collection.objects.link(ob)