My iPhone could not be restored. An unknown error occurred (4014)
The why is a quality check where the Apple software tests for a response from your phone and that response wasn’t measured. 

If I can assume you want a process to narrow this down, here is a guide. 


https://support.apple.com/en-us/HT201252


At the end, errors have some general fixes like restart and update. I would do all of them, they really fix many errors. 


https://support.apple.com/en-us/HT201210


At the end of all updates is a list of more errors, but I would do all the easy items first before getting to the page that lists specific error codes. Yours is quite involved and wants you to choose update or restore based on previous steps and really wants updates and restarts of the device before contacting Apple if you can’t get past the check. 


https://support.apple.com/en-us/HT201444