I experience this from time to time, happens often in the main hub; a few words on that, this is common, happens alot on minecraft, and even on other servers, why? poor connection, and servers capability to handle loading players in, softlocking you on a loading screen, until you leave, or the game somehow crashes.
trying to load in too quickly, or just poor internet is typically why, from self-experience, correct me if I am wrong.
Check your internet latency with /ping. This should tell you if it is your connection or maybe the game connecting to you.
View reply.