I tried to copy a project and got this error as a result:
We analysed the sf stored procedure task_copy_project and we think the order of the templates/code is wrong. After we inserted the project_vrs table directly after inserting the project table, and before inserting into the help_index, the project was copied correctly.