That’s usually a result of one of two things:
1.) you don’t have write permissions to the directory where it’s trying to save the files
2.) you’re not exiting cleanly (i.e., using the ‘quit RetroArch’ option from the menu) and are instead just switching back to the homescreen and killing it / letting it die on its own. This is a problem because RetroArch only writes the saves to file on exit, so if you never tell it to quit normally, it never knows to write it and the information gets lost when the program dies. There is an option autowrite the SRAM at an interval (I think the default is something like 10 seconds), which can alleviate the issue, for the most part.