The issue was happened when I try defining which collection is linked and which one is library override. When trying to target the linked collection, it is always pointing into the library override one, as you can see on the image below there are two collections named "chr_Small". The problem is when I try to do
bpy.data.collections['chr_Small'].override_hierarchy_create(scene, view_layer, do_fully_editable=True)
I can not do it more than one, however if I do for loop to get the actual collection as below code, I can do another override_hierarchy_create()
bpy.data.collections[-1].override_hierarchy_create(scene, view_layer, do_fully_editable=True)
However I need to do for quite many times on the same collection within the same library file, and also adding another library file.
Is there any proper/easy way to target the actual linked collection instead of relying on the index number of collection list in the scene ?