ESP8266, sporadically no write access to the file system
I have faced the same issue with my water leak detector, based on esp8266. It was caused by memory leak in the ESP binaries, so, I've updated it to ver 2.6.3

So, you can try to log (print to serial) free memory amount:

extern "C" 
{
    #include "user_interface.h"
}
uint32_t free = system_get_free_heap_size();