When you get this error this means the chosen reference has already been used in the past. You can only use a reference once.
Besides that you can't change a shipment which has the status DONE. This shipment has already been delivered and can not be change anymore.
To solve this error: Use a new unique reference and you can book the shipment without any problems.