23 is a hardware error. So your best solution would be to take it to Apple for Warranty Service.
Another exit of Restore Mode is a simple Hard Reset, Hold both Power and Home Buttons at same time for about 15 seconds until iPhone restarts.
I would also try a DFU restore. All functioning iPhones will do a DFU restore. Open iTunes, connect iPhone to computer, Press Home button and then Power button hold both for 10 seconds, then release Power Button, keep holding Home Button for another 10 to 30 seconds, iTunes will tell you by message box it has detected an iPhone in Recovery Mode, but it is actually DFU Mode if the screen is blank (black). If in DFU Mode then click Restore in iTunes.
Another possible fix of Error 23 is to clean the Dock Pins very well with isopropyll alcohol, take a few minutes and do a very thorough job. The pins are on top of the Connector Mid Rib.
Another possible fix of Error 23 is battery replacement.
Best fix of Error 23 in your situation is to see Apple. Good luck, Brad