not had a problem with CF but then I don't use my cards much, photography or otherwise.
With SD I think I've only had problems with corrupted files using a Sigma camera which produces 46mb files and takes ages to clear the buffer [writing to disk]. Pretty sure my corrupted files are down to me not realising th writing was still going on, and turning the camera off.
When shooting video, you may need a fast SD card or you could I guess get issues though I'm not sure of the nature of these.
Finally, my son had an SD card go bad in his phone but we got all his stuff back with the Sandisk utility in a PC. Card has been fine since - that's a couple of years of constant use. I could imagine the phone battery died when writing to the card and that caused the issue maybe.
I have noticed that my PC doesn't like CF cards formatted in-camera - reports an error and suggests it fixes them. This is mainly with an old camera and old 512mb cards. Also noticed that old readers can't read new cards . A new reader does the job. Actually had similar issues with some SD cards I think.
I wonder whether the variation in the firmware or whatever - in cards as well as readers - may be a contributory factor to the errors.
Then again I don't hammer my cards; once full I keep them as a kind of extra backup.
There are incidentally tales of particular models of certain brands of card being best avoided. But other websites indicate SD and CF are like CD/DVD media insofar as you don't know what's going on under the hood. Examples of the same brand/model may have different circuitry and component standards etc from batch to batch.