Thank you for the details of the issue you are experiencing with your iPhone. I found an article that specifically addresses error 4013.
Follow these steps:
Try these steps to resolve the issue:
- Install the latest version of iTunes.
- Restart your computer.
- Make sure your computer is up to date. If an update requires a restart, check for updates again after you restart.
- Restore using another USB cable.
- Restore your device on another computer.
If you continue to see error 4005, 4013, or 4014 when you restore your device,contact Apple for support.
Find the full article here:
Thank you for using Apple Support Communities.