It sounds to me that, in the worst case, the file is being accessed both read and write by several tasks!
Without knowing the code in more detail and not knowing the dependencies of the processes, it is very hard to answer your question.
Edit: I would keep the current samples in memory. These can then be read directly by the AsyncWebServer callback and elsewhere. This avoids having to re-read the file.
The samples can then be written to a file from time to time.
Please see How to post logs and code in PlatformIO Community Forum