Thanks for posting this additional information.
I am now fairly certain that your error is indeed caused by exceeding the 2048 maximum variable limit imposed by the standard I/O API library. The same error had been posted in this thread and switching to the “large” version of the library seems to have solved the problem.