While writing this question, I solved it myself, but I still want to publish it for others to see.
Here is the solution: I wrote the scripts on my Windows PC using Notepad ++. I saved them in a separate script folder on my NAS. Launching their NAS apparently worked, but there was one small detail that caused the problem. Carriage Return.
Although Windows uses carriage return (\ r) and , line (\ n) results in \ r \ n for a new line, a unix-based system uses only line (\ n)
By writing a script on a Windows machine, I basically wrote:
mysql --arguments < /path/to/script1.sql > /path/to/outfile1.csv\r\n mysql --arguments < /path/to/script2.sql > /path/to/outfile2.csv\r\n mysql --arguments < /path/to/script3.sql > /path/to/outfile3.csv\r\n mysql --arguments < /path/to/script4.sql > /path/to/outfile4.csv
Reading the file on Linux led to the following:
mysql --arguments < /path/to/script1.sql > /path/to/outfile1.csv?\n mysql --arguments < /path/to/script2.sql > /path/to/outfile2.csv?\n mysql --arguments < /path/to/script3.sql > /path/to/outfile3.csv?\n mysql --arguments < /path/to/script4.sql > /path/to/outfile4.csv
I found out about this by specifying the contents of the contained folder via SSH, which gave me:
ls -alh /path/to ... outfile4.csv ... outfile4.csv?
And we have it! It is for this reason that the last file works, while others do not. This is also the reason why there may be two files with the "same" name. Windows simply does not display a question mark, which causes a lot of confusion.
So, if anyone ever comes across this problem, he can stumble on this topic and save some time. I think this is common knowledge for most people, but I'm still new to Linux, so I had to study it hard :)