Hi Jashin,
When we have some old data and there are some constraints added on the same at that time while validating these kinds of errors we see.
Try to use the blank database and see if its working then you can identify the issues on the data. You might need some migration logic to fix the existing issues because of the migration.
There was a major change on the uniqueness in the Mendix 9. It handled in the database level now .
Refer this section – 4.1 Changes to Database Uniqueness in below documentation.
Moving from Mendix Studio Pro 8 to 9 | Mendix Documentation