When the server kicks the player for an invalid profile key, outdated client, or whatever else during the login phase, the player will see something like the attached image instead of the actual disconnect message
This is due to ClientboundLoginDisconnectPacket reading the component as a json string, but writing nbt
Can you please attach a crash report to the issue? The image alone is not enough to understand the issue.