What seems to be happening is that during entity enhancement, the MSC type acquires an ObjectIDType. When the enhancer reaches the entity types extending the MSC, the if-block:
if (_meta.getIdentityType() == ClassMetaData.ID_APPLICATION
&& (_meta.getPCSuperclass() == null || getCreateSubclass() ||
compares the entity type's ObjectIDType with its MSC, finds they are equivalent, so the entity enhancement does not add the app-id methods; the leaf entity types defer to the MSC's app-id methods. So when a new entity is being inserted into the persistence context, its initial ObjectID has the MSC in its type field, instead of the leaf entity type. If another entity extending from the same MSC has the same PK-value, OpenJPAId's implentation of equals() will think it is equivalent, failing the checkForDuplicateId() check.
I've included a potential fix for the above issue. It adds an additional check, looking for PKFields that are defined by a MSC. If it finds such PKFields, it walks up the inheritance tree, stopping at either the MSC defining the PKField, or at an entity type (to avoid breaking entity inheritance mechanisms). Stopping at the MSC defining the PKField qualifies the entity type for app-id method inclusion during enhancement. This way, the leaf entities use their own pcNewObjectIdInstance() methods (with the appropriate type coded into the method) instead of relying on the mapped superclass's version of the method.
However, there is a degree of uncertainty I have with the fix. While it fixes the described problem, and it does not fail any of the existing JUnit tests, I rely on the ClassMetaData.isEmbeddedOnly() method to determine if a type is a MSC or a genuine entity. From what I could tell, the ClassMetaData.setEmbeddedOnly() method is called only during annotation and ORL XML metadata processing (it is set explicitly false for MappedSuperClass types). However, the methods ClassMetaData.isEmbeddedOnly() and ClassMetaData.resolveMeta() are capable of mutating the ClassMetaData._embedded field; so there needs to be verification that relying on the _embedded field is the correct method of identifying a MSC type for this processing.