OK, I’ve had a look at the archive. The error comes into the class of “Something very odd is happening”
The error was because TeX was trying to turn the text متّی\mt1 متّی
into part of the running header line (\h
).
\h
is a special line which, because of how it is used in PTXprint, must occur on a line on its own, with no other USFM markers following it. The final USFM has a line:
\h متّی\mt1 متّی
Which is the cause.
Your input SFM file does not seem to contain this line, but it’s there’s one by the time the file gets to TeX. So I guessed that it is the changes file, and sure enough, turning off the changes file fixes the problem.
Digging deeper, I find this line, in changes.txt
"(\\toc3 (.+?)\s+)" > "\1\\h \2"
That line puts \h
on the same line with whatever follows it.
The following is a version which will not cause crashes:
"(\\toc3 (.+?)\s+)" > "\1\\h \2\n"
The \n
at the end, adding a new line.