The error is actually not very bizarre, it just says that a proc has been
called with one parameter when it expected two. The procedure is
proc myProc(a: string, b: TcpServer) = echo a
and with some debugging output in the right place
var prc_call = nnkCall.newTree(prc)
for i in 0 ..< prcArgsPar.len:
prcCall.add: nnkBracketExpr.newTree(ident "args", newLit i)
echo prcCall.repr # added, prints "myProc(args[0])"
it looks as if the generated call is indeed missing a parameter. The line
number of the error even points to the for loop that fills the list of call
parameters.