Another solution to try.
if the controller doesn’t turn on or stays on. Reset Xbox by pushing and holding the power button until it shuts off. Wait 10 seconds or more. [br]
Connect the Xbox controller to a USB cord (connected to Xbox) ,turn on the Xbox by pushing the power button. When the Xbox is on try to turn on the controller if it turns on great however if it does not simply push the sync buttons on both the system and controller sometimes by holding both the power button on the controller while still trying to sync it. You may have to try multiple times while doing it.
Once it’s done go to your settings, devices and connections, accessories. Once there click the three dots to update the controller as it may need updates. One of the reasons why your controller couldn’t connect to the system