The issue was that `CustomData_swap` modifies all layers, but does not ensure that the layers are actually mutable. This resulted in it modifying shared layers. Now it ensures that the layers are mutable first (which copies the layers if they are shared). Longer term, it would be good to remove `CustomData_swap` since it's not a good API performance wise, but that is outside of the scope of this patch. Pull Request: https://projects.blender.org/blender/blender/pulls/110678