Ensure that the view layer is properly synced before trying to get the active collection. Without the sync, imported objects typically get placed in the global Scene Collection rather than the new collection that was just created for the import. Pull Request: https://projects.blender.org/blender/blender/pulls/114650