The Go compiler is using the wrong err variable when handling an internal error in a handler method. Tested on fd62df75fa17d5c2af12302de6cee78ad7405692.
The relevant generated code looks like this:
The error in the TApplicationException should be err2.Error() and not err.Error(). Since err is nil at that point the server panics.
The patch for the Go compiler is a simple one line fix is attached.