Confusion on attached files :(

Hi,

I have created a custom doctype that works linked to the employee doctype. There were many scanned documents attached to this new file. We have tried to update the value of naming series of our employee doctype.

Then, we noticed that there was confusion in the files attached to the records. Some files uploaded to the server appear to be linked to incorrect records. How could this have happened?
Thanks