Have you ruled out the possibility that the device has a "BEDTIME" setting applied to it, from your account's wifi management? Sign in to your Xfinity account and check the device here: https://internet.xfinity.com/devices & check the "bedtime mode" option. (See screenshot)` It could be automatically signed off your network at midnight precisely through this method. Also, check your device(s) to make sure no similar settings put into a battery saving mode which shuts down your wifi. These may not solve your problem, but they should be ruled out before you take bigger steps.
... View more