Hi,
Even if you made a custom change to Purchase Invoice naming_series from the default autoname, migrate and data migration patches should not normally break the integrity of the (key, value) entries stored in the database.
If you are ok to query your database, this example session may help you check for clues to your issue.