It is not a bug. If you want to use spaces in the custom name, use this:
give @p apple[custom_name='{"text":"This is an example"}'] 1
It can be bad if someone tries to connect over and over again, because if they did it can spam the chat with leaving and joining messages, and i think it's important to not allow the player to join multiple times. It can be helpful for let's say the player makes sure he is in that server. He would know if it says "you are already connected."
Thank you! It does work! I haven't thought about that. It is kind of strange that the old method does not work anymore for this.