UnPredicable exception, Invalid statement found Line:(4)

UnPredicable exception, Invalid statement found Line:(4)

I've recently deployed my Creator app to a client and he's receiving errors that I can't reproduce on my development account. One of these is " UnPredicable exception, Invalid statement found Line:(4)" when a custom action is run. The first few lines of the function called are:

void CustomizationCompleted(Customization_Form Pers)
{
    OrderID_List = List();
    for each P in Pers
    {
        //set Personalization Complete to "Yes"
        P.Customization_Completed = "Yes";
        TheOrderItem  =  Order_Items  [ID = P.Order_Item_ID];
        TheOrderItem.Customization_Completed = "Yes";
        //store a list of orders
        OrderID_List.add(P.OrderID);
    }

Could you please let me know why this happens once published, but not in the development environment?