PIM-2923: Fix issue on EntityToIdentifier

| Q                    | A
| -------------------- | ---
| Bug fix?             | Y - PIM-2923
| New feature?         | N
| BC breaks?           | N
| CI currently passes? | Y
| Tests pass?          | Y
| Scenarios pass?      | ?
| Checkstyle issues?*  | N
| PMD issues?**        | N
| Changelog updated?   | ?
| Fixed tickets        | PIM-2923
| Doc PR               |