Not sure of the cause of the problem but sometime I need to put a brief pause in a script to get it to run correctly. For some reason the script needs a little extra time to run properly. When you use the script debugger each step gets a pause..
This isn't the case where the field is too small and the value is replaced by question marks?
I put a 1 sec pause in the script and it works now!!