I am not gonna watch all of it but i am gonna ask is the bug you lagging?
If its that then maybe u were mining with an autoclicker for a long ass time and ur pc couldnt handle it. Happends to me if i mine for 1-2 hours, when i try to type in chat it freezes and then it opens chat.