Apple doesn’t explicitly list error #4045, however, 4000-series errors are often associated with the host computer having difficulties contacting Apple’s servers. Communication difficulties of this nature are often linked with Anti-Virus and/or firewall software running on the host computer.
While you do so entirely at your own risk, try temporarily disabling your AV/Firewall software - and then repeat your attempt to restore your iPad.
Otherwise, you may need to seek assistance directly from from Apple Support. You can contact the Support Team using the Get Support link at top-right of this page. Alternatively, if you have access to another Apple device, you can initiate and manage your support cases using the excellent Apple Support App. If not already installed, the App can be downloaded from the App Store:
https://apps.apple.com/gb/app/apple-support/id1130498044
You might also visit the Genius Bar at your local Apple Store or Apple Authorised Service Provider (AASP) - where the technicians will be able to provide assistance:
Genius Bar Reservation and Apple Support Options - Apple