Xml file is changed even though adding a new part fails

When you change the model in the Architect and adding a new part (dependency, task…) fails with an error, the original xml origam file is still changed.

I think this is basically a duplicate of Wait task in workflow has wrong namespace

It is not. It happens also in other cases, this was just the most recent and easily reproduced.

If it is so I think you will need to provide examples. This particular case is not caused by failing when saving but saving a wrong thing and failing to read it back.