Could you please check your network settings? Most probably some of your network ports are blocked.
Go to network tab, xbox app or xbox, and review NAT type. If NAT was blocked, then check your modem/firewall ports
Use a wired network if possible, if the same issue still exists, you could try switching the network by using someone’s phone as a hotspot.
If you’re on xbox, check if your xbox gold memebership has not been expired.
This is all what I could provide as that problem is horrendous.
Check out the following topic:
Every time I have logged on for the past day I have been unable to connect to the gears services I’ve been trying to look up the error code and how to fix without any luck. Pc and xbox also i m flagged so i cant respond…
Update: its something to do with the account i made an alt account and it works just fine
it started happening after i changed my gamertag!
Open these ports on your router or gateway so that your network hardware can communicate with the Xbox Live servers:
Port 88 (UDP)
Port 3074 (UDP and TCP)
Port 53 (UDP and TCP)
Port 80 (TCP)
Port 500 (UDP)
Port 3544 (UDP)
Port UDP 4500 (UDP)
Your last resort is to uninstall then re-install the game, best of luck!