Summary:
When we create a UDF on Project/Task level then this UDF is available on all the projects, tasks and sub-tasks. When we make it required then we need to make sure all the projects, tasks and sub-tasks have some value in the UDF.

Cause:
The issue could mostly happen when we change a UDF from not required to required. A project or task may have been saved without any information in the UDF and after we change it to a required UDF and try to create another project based on this one we get the above mentioned error.

Resolution:
So whenever you are creating a project based on a template project and if there is a required UDF in the template project, make sure there is a value selected for the UDF in all the projects and tasks in the template project. This should resolve the issue.