You could have wrapped your ORC.12 logic in a catch.
catch {
set ORC_fields [lreplace $ORC_fields 12 12 with your replacement]
}
If ORC fields come inbound shorter, than there is nothing to replace. Having said that, if for some reason you must have something entered in ORC.12, you would go with the field length to build it out.
😉