Entity names cannot be created or modified using the /summon or /data commands. The command returns "Unable to summon entity" or "An unexpected error occurred trying to execute that command"
How to reproduce:
Attempt to summon an entity using
/summon bat ~ ~ ~ {CustomName:"Gun",NoAI:1b,Silent:1b}
Attempt to rename an entity using
/data merge entity @e[type=bat,limit=1] {CustomName:"Gun"}
Item/Entity/Block names all need to be json as of 1.13 (just like book pages and sign text already was.