When a golem reaches the state where it turns into a statue, its data, or more specifically user data and most likely other components, are not saved.
*Edit
Linked issues
Comments 3
Can confirm the CustomName entity tag is the only data copied to the copper statue block from the copper golem entity. The CustomName is copied into the entity_data component on the block instead of the custom_name component, and since the loot table does not specify any components to copy to the item, all of the data is lost upon mining the statue block too.
It would be expected that the custom_data component (the βdataβ entity tag) would be copied to the block, and that both the CustomName and βdataβ entity tags would be stored in the block as the actual components, rather than inside the entity_data component. This would also allow the loot table to preserve certain components, as the game does for other block entities.
Thank you for your report!
We're already tracking this issue, so we will resolve and link this ticket as a duplicate.
If you would like to add a vote and any new information to the main ticket as a comment it would be appreciated.
If you haven't already, please make use of the search feature, to see if the issue has already been mentioned.
Quick Links:
π Issue Guidelines β π¬ Mojang Support β π§ Suggestions β π Minecraft Wiki
It was accidentally said that Custom Name is not saved, although in fact this is not true, at least it was just noticed that "data" is not saved