the command:
/tellraw @a ["{\"text\":\"\",\"extra\":[{\"text\":\"daylight cycle \",\"color\":\"gold\",\"hoverEvent\":{\"action\":\"show_item\",\"value\":\"minecraft:clock\"}},{\"text\":\" on \",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/gamerule doDaylightCycle true\"}},{\"text\":\"or\",\"color\":\"gold\"},{\"text\":\" off \",\"color\":\"red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/gamerule doDaylightCycle false\"}}]}"]
tells you everything after @a rather then " daylight cycle on or off "
I have tried restarting minecraft to see if it is a one-time bug and it did not fix it
Backslash is the escape character, and means to literally print that character. So the command is doing exactly what you told it to. Your command should look like this: