You have a relationship between the two tables, but there's no link between the new task table record and any record in the Project Table until you enter a value into the Task Table::Project ID Number field.
Thus, at the time this script step executes, Project Table::Project ID Number cannot refer to any record in the Project Table as you are currently on the Tasks Table layout with a new record not linked to any Project Table record.
What you can do is put the ID number in a variable before you change layouts, then use set field to copy the value from the variable into the ID field of the newly created record.
Set Variable [$ID ; value: Project Table::Project ID Number ]
Go to Layout ["Task Table" (Task Table)]
Set Field [Task Table::Project ID Number; $ID]
Go to Layout [original layout]
Such a "memory" really wouldn't work for all situations. There are many databases where you have multiple layouts based on the same table--each with different current records and the record you want the set field step to access might not be the current record on any of them.
That said, you can use scripting to program such a thing into your database if you want it:
Open up field options for Task Table::Project ID Number and give it this auto-enter calculation:
Then, on your project layout, use the OnRecordLoad trigger to perform this script:
Set Variable [$$ProjectNumber ; value: Project Table::Project ID Number ]
Now, any time you create a new record in the Task table--either manually or via your script, it will automatically link to the current record on your project layout. (But this won't work if you go directly to the Task layout without ever visiting the project layout to trip that trigger to load the ID into the global variable.)