If you try writing to a file in the directory before it is created then it will be a problem. I don't think it will be a problem in Calabash; I assume it completes all the parts of a script before it returns, but a streaming XProc implementation could return the c:result document before the px:mkdir step executes, which would sporadically throw an error.