Grease Pencil layers can only be duplicated on the same object. Duplicating layers from other objects will not insert the drawings into the target object and just assume that drawing indices remain valid, which is not the case. The subsequent drawing index user update crashes Blender. This fix adds a new `copy_frames_from_layer` function that makes a full copy of layer data, regardless of where that layer originates from. This is safe to use with layers that live in other objects. Pull Request: https://projects.blender.org/blender/blender/pulls/133722