Attachments of Child Table `Attach` fields not shown on parent any more


The standard behavior of Frappe/ERPNext is that if something gets attached to a Attach or Attach Image field on a row in a Child Table, that attachment shows in the side bar of the parent document.
This is the preferred and confirmed behavior in at least:
ERPNext: v12.10.1 (version-12)
Frappe Framework: v12.8.1 (version-12)

But in at least these two versions, this bug appears:
ERPNext: v12.14.0 (version-12)
Frappe Framework: v12.12.0 (version-12)

as well as the latest
ERPNext: v12.16.2 (version-12)
Frappe Framework: v12.13.0 (version-12)

To replicate the bug, add an Attach Image custom field to any child table doctype, and then attach something to that field. The attachment briefly appears, but then it vanishes after the parent doc saves:

I get the same problem in frappe v12.25.0
but what I notice that the attach linked to the child table in File Doctype instead of the parent
,and also because it linked to child table before the child table being saved with name in database
the field “Attached To Name” will be wrong