Alter your regular expression to include the preceding segment delimiter, e.g.
regsub -all “x0dNTE” $msg “x0dOBX” $msg
If you look for the field delimiter (|} following the segment identifier (NTE), ignoring the preceding segment delimiter (x0d), you could alter fields which end in “NTE”.
Try it at the TCL command line to test it.