The cause of this is that the save queues are already created. So the validation routine is too late. At the moment I'd advice you to do something like:
task.Resources.Add(newResource);
AddResourceToProject(newResource);
and in AddResourceToProject() you add it if it's not already there.
This is necessary because you can't tap into the add method at the moment. This is a thing we can't address properly today, but we will definitely address this in v2, as we can then make the necessary architectural changes to make it possible. Effectively, what you want is:
bind to a PreAdd() event (or something like that, AfterAdd can also be the one) of the Resources collection in Task. you add that code in Task. In that event handler, you then do: task.Project.AddResource(addedResource) or something like that, which means: you mange it from the task entity, not from code outside the task entity.
This is a known problem, and at the moment the workaround is to place the logic which assigns the resource into control of adding the resource to the project as well.