Just sharing how I solved a similar problem.
On my PC, OneDrive was downloading .txt files. It turns out it's because of windows's indexing function that runs once in a while.
While this might be useful (allows windows to search content of text files when you search for something), you might want to remove it.
To fix this you have to disable File Contents for txt files (or any other you have problems with) .
Here is how to do it:
To disable indexing of file properties and contents in Windows for TXT files or any other file type, follow these steps: nullnullnullnullnullnullnull
After disabling indexing of file properties and contents for a specific file type, the indexing service will only index basic file properties, such as the file name and date modified, without indexing the contents of the file. This will prevent unnecessary indexing and downloading of files, which may help improve system performance and reduce network traffic.