The official wiki says that bossbar names can be defined by JSON components.
However, it does not work, it only displays the raw string like
{color:#333333}{"text":"Bossbar","bold":true}{color}
if I do /bossbar set foo:bar name "{\"text\":\"Bossbar\",\"bold\":true}"
Your command is incorrect. This is the correct one:
The extra quotes aren't needed.