Typing in the tag /give @s minecraft:trial_key[minecraft:custom_name=\\{"text":"Big Trial Key", "color": "dark_purple", "font": "minecraft:alt"}]
like you would in the /tellraw command will throw this error:
Malformed 'minecraft:custom_name' component: 'java.io.EOFException: End of input at line 1 column 3 path $.'
However, typing in the same tag in Data Pack format works perfectly:
{ \"text\": \"Big Trial Key\", \"color\": \"dark_purple\", \"font\": \"minecraft:alt\" }
Invalid. The text component in the
custom_name
component is a string containing the JSON, so the correct command looks like this:or