I've been experiencing this for about 2 years now, and it's just been getting worse. Whenever I try to play with my friends on Xbox or ps4, the game will randomly make me disconnect from the server or disconnect if I tab out, and then they will have to either reset their world or the entire game for me to join back. The same issue happens when I host, but all players will disconnect only if I tab out. This gets extremely annoying, and recently it's gotten really bad to the point where I can't even play with my friends anymore, and the game is also just super laggy, even though both of our internets are fine. Heres a video of what happens: https://youtu.be/Tw58yATwOJc
Related issues
duplicates
Comments

Thank you for your report!
We're actually already tracking this issue at MCPE-19393, so I will resolve and link this ticket as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki