I had this error message when I tried to generate a mission with an incomplete script. When I had deleted that script in the editor the mission was generated without problems. So I would recommend to check your scripts for incomplete conditions or orders.