Issue #3089724 by Charlie ChX Negyesi: createDuplicate is checking the wrong entity type and WSODs on broken reference