Well, it could be a few things.
1. The card could be dirty (or the slot could be).
2. Your battery could have fluctuating voltage which can make the card not work.
3. A new (possibly thicker) battery being put into the phone would 'squeeze' the SD card slot, making it not function correctly.
4. Three could be rust inside the card slot. Especially if they phone has ever been wet.
5. There is malware on the phone or the card.
6. The card could also be formatted incorrectly, which would cause the phone not to read it.
7. It could be damages on the card or it could be broken.
8. Or, it could be the phone and not the card that is the problem.
Personally, I would start with cleaning things up and reformatting the card.