Unexpected "Null" Results

Hello.
Thanks for providing code , but you could take further steps to make it more convenient for other forum users to help you.

Share some representative data that will enable your code to run and show the problematic behaviour.

You might use tools such as the library datapasta, or the base function dput() to share a portion of data in code form, i.e. that can be copied from forum and pasted to R session.

Reprex Guide

Further Advice.
If you have code that process many files, in iterative fashion, ask yourself if the repetitions are relevant to the problem, or would you see the issue with a single file ? If so your example should only concern a single file.
If your issue does not relate to file reading per se, i.e . You have no problem loading your raw data, your problem is manipulating/processing it, then you should modify your example to exclude all file loading code and substitute that code with example data that you prepared following the guide.

Good luck