Unexpected vertices when looping through meshes in Scene Collection
Your scripts are incorrect, you are ignoring scene objects and repeatedly printing data for the active object instead.
In both cases you are looping over scene objects with
for i in bpy.context.scene.objects:

Then you proceed to ignore them all by defining an &quot;active object&quot; with either obj = bpy.context.edit_object or me = bpy.context.object.data rather than iterate over i from the loops.
It should probably be something like me = i.data.