The problem is much easier than I thought. Spring calls the mentioned method while deleting an entity inside the repository proxy. And contains(Object) does not use the entity-name-resolver to check if there is an entity-persister.
See attached test