Originally posted by CathW Open “Disk Utility” on your Mac
Mac? That may be part of your problem. I really like Mac, but every once in awhile we get a troubleshooting request regarding SD cards and often enough, a Mac is part of the mix. At issue are temporary files/filesystem left on the card as a result of a removing the card without an unmount or eject. Those residues may make the card behave strangely when in the camera. A similar problem may happen with a Windows computer, but the Mac seems to be more prone.
The deep erase you describe seems to have worked for you, but I would suggest that an out-of-camera format using other than OS X may be preferable. The SD Association (manufacturer's group) provides a free formatting utility for both Windows and Mac that will do a cross-platform format free of file system artifact.
https://www.sdcard.org/downloads/formatter_4/index.html
Links for the utility's documentation are found at the bottom of the page. Once formatted using the tool, the card may be optionally formatted in the camera, though it should not be required.
Steve