Hello,
If the Surface Duo is shutting down, please first make sure the device has the latest update. Go to Settings > System > System Update > check for updates.
If the issue continues, you can Factory Reset the device, after backing up your information first. Settings > System > Reset Options > Erase All Data (Factory Reset).