If its in a localscript in ReplicatedStorage (and not ReplicatedFirst), and I’m not mistaken, then the code shouldn’t run at all. Are you sure you aren’t modifying the coreguis anywhere else?
Please don’t reply if you aren’t sure of something or at least have a basis to stand by because you run the risk of providing incorrect information.
This is not intended behaviour for the chat scripts but whether it’s a bug with the scripts or the implementation isn’t known. As for what you said “isn’t needed”, all that does is modify the chat settings so that both bubble and regular chat can be used. The line is irrelevant to the problem.
There’s a lack of information on this thread so it’s pretty hard to determine what the source of error is. Remember that you should always provide as much detail as you can. Mind explaining how your chat is supposedly breaking or disappearing? Context is needed behind that statement.
Another thing:
RegisterChatCallback with OnCreatingChatWindow is best used in ReplicatedFirst so that you can hook the callback before the chat scripts invoke it, let alone load up. It may break convention for your code but I strongly recommend moving that chunk to ReplicatedFirst.