Just noticed that the
EncounterType has a unique key constraint on its
name field. See EncounterType.hbm.xml#26
This issue with this constraint is that it prevents to create an encounter type with the same name, even if its homonymous entity is retired.
This is the ticket that introduced the change: https://issues.openmrs.org/browse/TRUNK-4044
Such constraint is not applied to Visit Types.
Additional research found that few entities have such constraint as well:
Is there a rule to decide when we should make an entity