Hi FTrump,
While it might seem like a bug, this is actually the standard technical behaviour for almost all web-based and mobile online games today.
Most modern operating systems (iOS, Android, Windows...) and browsers (Chrome, Safari, Edge...) are designed to prioritise the site you are currently on to save battery and memory. When you switch away, the browser pauses the inactive tab.
Since online games require a constant connection, this pause causes the server to register a timeout, leading it to close the connection. Even if you aren't in a match and are just in the lobby, the game server will terminate the connection after about 30 seconds if the tab becomes inactive