Restore a DMG (maybe an OSX InstallESD.dmg or any other application) to the disk/drive via Disk Util. This will overwrite it (deleting all data). Then you can partition again how you like.

I have encountered this several times myself with USB pen drives as well as SSDs inside a MacBook Air. Formatting and Erasing brought up the exact same errors you describe. DD didn't work out, Resizing the partition gave me an error about corruption on the disk. First Aid/Scanning & Repairing the volume didn't yield any results, the tool completed with the message that there wasn't anything to repair.

Only the Restoring of a random DMG to the drives made it manageable again.

Hope this helps!


Similar problem, so I tried erasing as FAT… (can't remember the exact format) which worked. Then was able to erase again as Mac OS Extended (Journaled).

I suspect my problem was that I had made the disk a boot drive at some point.