Ist mir bekannt.
Ich habe im Projekt nur eine Datei Operation für Laden der Konfiguration
XML. Soweit kommt er aber nicht...(Callstack)
Das ändert aber nichts an der Compilieren vs. Erzeugen EXE. Die Konfiguration ist die gleiche.

Well, that main thread stack make sense in its context,
The
exception reported at line 64, while line 64 in the
dpr is the exiting point of the except..end clause, meaning an
exception is not handled and escaping, in other words it was
exception inside the
exception handling !
Let me guess, the sleep is not executed, and the Writeln is the failing one and raising
exception.
How this happen ?
Well this bring us to the APPTYPE, the standard output is malfunctioning and this can be ... i don't know every case out there but will list what comes to mind at this moment and it is your job to figure out the cause:
1) APPTYPE is broken in the project, meaning you created
GUI and then later add the CONSOLE, any conflict here will cause problem in the
RTL compiler added code to
handle the standard console pipes.
2) Are you using command lines ? namely are there something like " ..... >debuglog.txt" or the other one "... >> sometext.txt" ?
3) there is
AV locking your writeln, hence again it might be a file, but if that is not it, then are you creating the process differently ? like using another EXE to run it ... to shorten this : running this application from a console directly by its name, will the
exception/crash manifest ?
Now to summarize the failing point, Writeln is one that failing, Writeln is compiler magic and wrapped with many functions, these are using specific code to
handle Windows standard pipes, start there.