When I attempt to release a purchase order from hold via the API, sometimes I get the following error:
Operation failed: At least one line is not present in the cost budget of the project. Either add the corresponding budget lines to the project or select the Allow Adding New Items on the Fly check box on the Summary tab of the Projects (PM301000) form
I get the same error when try to do so from the user interface:

Oddly, if I try a second time, either via a repeating the API request, or by pressing the button again, the error does not occur.
What could be going on?