Issue #2925913 by alexpott, amateescu: EntityReferenceItem logs critical errors in onDependencyRemoval()