yes sd cards are the worst. always check them with the free h2testw.exe . got so bad i now prefer to pay more for second hand ones from a reputable ebay supplier i found.
That simplistic PoS is simply to tell you that it can indeed hold the amount of data it claims, rather than test its quality or reliability.
I would prefer to buy a good one than buy a cheap one that either passed or failed any test I applied to it. Even if this h2test thingy told you it was below capacity, you'd have to explain this to the
lowlife seller that you got it from, and hope for a refund, then post it back.
If you had a load of family photos in your dressing table drawer, and someone ripped them all up, how would you feel? It's the same thing really.
And don't think 'good' SD cards are immune from failure either.