This will happen if multiple items have the Same Item ID assigned to them
you say:
I added a modification to the discount value (in the Shopping Cart), where I simply change the value of the discount to something else.
what happens if you take that code out?
If taking that code out fixes the problem, then something is wrong in discount code.