This commit fixes the crash itself, however this can still lead to a same collection 'owning' the same object several time. Issue here was a bad assumption in layer resync code, that would lead to removing valid objects from the viewlayer's `object_bases_hash` in `BKE_layer_collection_sync`, when deleting no-more-used bases, in case of bases duplicate.