Fix/create work packages with validation errors

fixes the error reported in [#1789](https://www.openproject.org/issues/1789)