File attachment lost during merging of records
What you describe sounds like this bug https://lab.civicrm.org/dev/core/issues/723 


  File custom fields cause a fatal error when trying to merge
  If you are trying to merge a contact with a custom field that is a file, if the contact that will be deleted is passing a file to the remain contact, the merge will fail, generate a fatal error, and lose all the custom data in the set including the file.
  
  To recreate:
  
  Create a contact custom field that accepts a file.
  Add files to one or two contact records.
  Merge a contact with a file into another contact
  Fatal Error occurs. All files are no longer attached to the custom fields. The contact to be deleted loses all the custom fields. While the remaining contact looses only the file.
  If the contact that is to remain has no image the error message is
  
  No record found for given file ID - 0 and entity ID - 203


I'm also seeing this in CiviCRM 5.10.3. So I would say this is a known bug which has not yet been fixed.