The validation was always failing when trying to updating an LMS Batch Membership document. This was due to a bug in the validation logic that was considering itself as a duplicate record. This has been fixed. Also added tests to verify that.