Possibly, there're some issues with the connection between the SD card and your phone. For example, the SD card's contacts get dirty, the SD card slot is sloppy, or your SD card is physically damaged. It could also be a capacity issue. Is the capacity of your SD card larger than your phone supports? Also, your SD card may have some logical errors that are causing the issue.
Reason 1: Faulty hardware.
Memory cards, especially microSD cards, are very prone to damage. Once the card's contacts are broken or lose conductivity, your phone will recognize your SD card as removed. Also, the built-in SD card slot could stop working somehow. You can try connecting your SD card to the phone via an SD card reader to verify that.
Reason 2. Unmatched SD card capacity.
This might sound new to you, but if you use an SD card with a capacity that is larger than your phone can support, issues occur. For example, the SD card gets unexpectedly removed. Therefore, you should ask the manufacturer for detailed information about the supported SD card capacity.
Reason 3. The SD card has some logical errors.
Your SD card can be logically corrupted for many reasons, such as malware attacks, viruses, and improper formatting. Have you tried the SD card on multiple devices without ensuring the working environment? Perhaps, you should run an anti-virus check on your SD card.
Or, the file system of your SD card is corrupted and needs repairing. Luckily for you, you can check and repair corrupted SD cards on Windows using the CHKDSK command. If nothing changes after the repair, recover data from the corrupted SD card with iBoysoft Data Recovery and format it.