Something like that is probably the memory card failing, or if it is fairly new not properly compatible.
My experience with not compatible cards is, if it is bad it will not even format in the system, if it is not so bad it will work for some hours before it ask for format, some even go as far as filling up before they ask.
Also experienced once a card stopped working after months, but then i just formatted it again and it worked again just fine, i suppose there is a reason some systems have a format schedule / reminder feature.
I have personally had ( in the old days ) two 64 GB memory cards die on me so fast they barely got to fill up just 1 time, and these was genuine brand cards, the replacements also worked for a long time after that, actually the one i still have just don't run small 64GB cards anymore.
It could maybe also be condensation, i have one time had a card that was working stop, i just cleaned / wiped the contact surfaces on it, and it was back up and running.