Attempts to resolve #9648 (closed).
The script is failing when it tries to anchor a floating selection. Since pasting no longer automatically creates a floating section, a conditional check is added to only do this if necessary.
Edit: There seems to be other issues separate from this. Setting as draft for now.