Hello!
I believe this is just down to your connection; possibly try restarting your router, or if possible using an Ethernet cable has really helped me with connection issues! I’d also recommend trying out clients such as Labymod, Lunar or Badlion - since switching to labymod, I’ve also noticed some improvements with my connection.
Also possibly try playing in a different version (1.12.2+). I hope your issue gets resolved!