#89327: Went back to a code more similar to the one used to fix #85692, ...

...but checking that the collections aren't equal, so persistence of layer properties still works while previgint the orphan-removal problem the old restored code was added to fix.