Hi, What MahGah mentioned is one possibility. But you said that there is no problem after pasting, it may have nothing to do with that option.
I'm very concerned about one thing, how are these lines added to the system?
This looks to be imported in the program and not validate to other quantity fields.
For example:
SalesLines.Quantity := 10; -> This can cause problems
SalesLines.Validate(Quantity, 10)
You can open the Sales Line table and see if there are any values in the fields below.

Hope this will help.
Thanks.
ZHU