const VArray<bool> &selection = *curves.attributes().lookup_or_default<bool>( ".selection", ATTR_DOMAIN_POINT, true);
Avoid to do extra copy/user counter increment.
I can confirm, however this issue has been reported before, see #103395. Will merge reports. Please subscribe in #103395 if you want to see further updates
In this case, you'd better report the bug to the addon author. We can't fix the problem if it's not in blender, but in a script.
I can't reproduce it either. In addition, it is better to remove the script.
I explored a similar bug. Some kind of modifier, or something else, multithreadedly takes some single data for writing. A result of 10 copies, this is an attempt to delete itself 10 times. But…
I can reproduce this in last 3.6, but not in last 4.0.