This was more of an accidental discovery when we attempted to rename a Wizard and generate a new URL for it.
As we didn’t want to manually re-create the Wizard from scratch, we exported the Wizard and edited the ID to attempt to facilitate this.
For a bit of further elaboration, the wizard appears in the Manager tab, however attempting to export it will result in {"failed":"FAILED","error":"No valid wizards selected"} being returned.
Likewise with destroying, it will give the error originally stated in the OP.
Additionally, this actually results in the Wizard remaining in the Manager section of the plugin, unable to be interacted with.
I’ve also encountered this issue, for exactly the same use-case: attempting to set a different URL for an existing Wizard.
The other use-case is to duplicate a Wizard as a shortcut to developing a new one which shares similar functionality.
The Custom Wizard Plugin doesn’t provide either of these functions in the UI, but it would be very helpful if it did.
Likewise, it would also be helpful if a non-compliant ID was captured when attempting to import the .json so that a corrupt Wizard never makes it into the database. I’m no dev, but I’m guessing that this would be easier to implement.
If you’d like to remove the corrupt Wizard from your instance, you can do so via the Rails console (be careful):