Issues with the "Separate by selection" operator. Reported by the Blender studio.
There were multiple problems in this code.
1. When a new object is created, the parameters are not copied.
2. When a new layer in a new object is created, the parameters are not
copied.
3. The code to transfer the layer attributes was not working correctly.
Fixed all the issues above. The layer attributes are now transfered once
after all layers have been added.
Pull Request: https://projects.blender.org/blender/blender/pulls/131449