The class metadata comparison ensures that the two objects are represented in the ORM in the same way: be it a proxy or part of an inheritance. The class name was not sufficient here.