You get this if it tries to delete the last version.
Error: delete version API failed. You cannot delete the last version of a package. You must delete the package instead. 
Think it would be a good idea to add an option that says what to do in this circumstance? I see three things that this could do:
fail the step like it does now
keep the latest version
delete the whole package
Might also be a good idea to warn people that this step might fail if it tries to delete the last version in a package.
Edit: the step also fails if the package is already deleted...