Were you booted from the Recovery HD when you did this? Was the disk unmounted? If so, then the Operation failed... error could mean that you may need to try simply reformatting the Untitled entry in the sidebar:
Repair the Drive for El Capitan or Later
- Restart the computer and after the chime hold down the Command and R keys until the Utility Menu appears.
- Select Disk Utility and press the Continue button.
- Then select the indented (Untitled) volume entry from the side list.
- Click on the First Aid tab in the toolbar and wait for the Done button to activate. Click on it, then quit Disk Utility.
- Select Restart from the Apple menu.
If this doesn't work then try this:
Clean Install of El Capitan or Later on a Clean Disk
- Restart the computer. Immediately after the chime hold down the Command-Option-Rkeys until a globe appears.
- The Utility Menu will appear in from 5-20 minutes. Be patient.
- Select Disk Utility and click on the Continue button.
- When Disk Utility loads select the drive (usually, the out-dented entry) from the side list.
- Click on the Erase tab in Disk Utility's main window. A panel will drop down.
- Set the partition scheme to GUID.
- Set the Format type to Mac OS Extended (Journaled.)
- Click on the Apply button, then click on the Done button when it activates.
- Quit Disk Utility and return to the Utility Menu.
- Select Reinstall OS X and click on the Continue button.
To install the version of OS X that was currently installed use Command-Option-R. To install the original factory version when the computer was new use Command-Option-Shift-R.
If you are unable to get the above to work then it's possible the SSD is no longer working. Make an appointment at the Apple Genius Bar for service. If you need to find an Apple Store - Find a Store - Apple.