To test your connection on Xbox, please follow the steps below:
1. Press the Xbox button on your controller
2. Scroll right to the menu Profile & system and select Settings
3. Go to General > Network settings > Test network connection
4. If there are no errors, select Test multiplayer connection
If the issue still persists, please troubleshoot your connection using the official Xbox page: Troubleshoot your Xbox network connection