GrapheneOS implements basically this as a security feature against non-persistent malware, and I think it's a great idea that all phones should do. Graphene has your phone reboot after an uptime greater than some value you pick.
It automatically reboots after the device hasn't been unlocked within the selected duration, not after certain uptime has been reached