This is Bug 2421304, fixed in 5.0.20. It happens when posting a batch detail item that has a benefit that will create a classification if it does not exist on the account already, and the benefit is assigned to a name_id greater than or equal to 10.

On prior versions you can avoid this error by

a. Creating an active classification that the benefit was going to create for that account and name_id, so it doesn't have to create one

b. Changing the name_id on the benefit to one that's only one digit.