C4C has an interesting quirk (I wouldn't go so far and classify it as a bug):
Assume you have a reuse function that returns a value.
In this case, you need to make sure that your script always (i.e. in all scenarios) explicitly (i.e. using the return statement) returns a value.
If you don't, it will return the same value it returned when it was previously called.
Example: Say your reuse function is designed to do something and in case of error an error code is returned. In case of success you return "nothing" - as no error occurred.
Following good programming practice, you explicitly clear the return value at the beginning of your script. You implement your logic, returning error values where appropriate.
But you don't explicitly return an initial value in case no error occurred.
If that function is than called in a loop (say you're running an MDR or a Data Workbench upload) for multiple business objects and for one of them the reuse function returns an error, then it will return the same error for the next one - even if it didn't hit a return statement in the script!
So make sure you explicitly return a blank value in case of success in this example.