Temporary properties created by the foreach task cause the property::exists() function to return true even outside of the foreach task. Referencing these properties of course causes NAnt to fail.
See this example:
When a SQL Task cannot connect to the specified server/database, it will cause NAnt to crash. This should be changed to just cause the task to fail instead of crashing NAnt.