Yes that seems to be the best explanation for this behaviour. But I'm not sure how to troubleshoot this kind of a scenario. The thing is we don't have any scripts/workflows interacting with the Customer Deposit record, so it is strange that it fails for this particular record. I also have appropriate permissions in place and attached to the .ss file that triggers this code.