Blender Background Scripting: Use bpy.data, Not bpy.ops
Blender's bpy.ops operators fail without a UI context in --background mode. Build geometry directly with bpy.data.meshes, bpy.data.objects, and scene.collection for reliable headless automation.