I've had that happen before. If you use a Windows machine, here are the instructions:
Step 1: Plug in your SD card to PC.
Step 2: Press Win+R on your keyboard, then type in diskpart and press Enter.
Step 3: When you see DISKPART> type in: list disk
Step 4: Find your SD card in the list (DISK X SIZE 16GB or something similar). MAKE SURE IT'S YOUR SD CARD. YOU MIGHT FORMAT YOUR C DRIVE!
Step 5: When you see DISKPART> again type in: select disk X
X is the number of the drive you've identified above.
Step 6: When you see DISKPART> again type in: clean
Step 7: When you see DISKPART> again type in: create partition primary
Step 8: Once the above command is done, go to WIndows Explorer and format your SD card like normal. Plug it back inside the phone and format as internal storage.
SD memory cards must be replaced at first failure in my opinion.
All memory cards have a limited lifespan, especially when used as internal memory. A good quality, genuine, reputable brand SD memory card may last for some years, poor quality ones fail within weeks or months.
Memory cards can not be repaired by partitioning or formatting.
The defect is still there, even if all seems well at first, but the phone will freeze or crash when it try to use data from a defective memory area on the SD card.