It sounds like you are using standard task sequences (3d port-connection logic) to transport items. Deleting the items without also removing the pending task sequences for them would explain the error.
I would recommend to handle the transport logic in Process Flow in this case. That way you can simply not add unload tasks for items past the first.
If that is not an option, you can iterate through the pending task sequences of the operator delete all of those that involve the items you are about to destroy. The attached model does in the OnUnload trigger. The code assumes that the operator only receives standard transport task sequences (consisting of Travel, Load, Break, Travel, Unload).