The reason it doesn’t work is because you set the specialType to the root project, which will automatically propagate to all its sub projects, so in effect you set all projects.
Notice if you access it.specialType directly, there will be exception if the project doesn’t have this property, so you need to use hasProperty to do the check.