It's some weird interaction with the Tcl http package.

Your adapted script below reproduces the issue for me whereas your original script doesn't.

source ./wapp.tcl
###
package require http
proc wapp-default {} {
  wapp-trim {
    <p>Visit the <a href='%html([wapp-param
    page for a slow-to-load case.</p>
  }
}
proc wapp-page-slow {} {
  ###
  set tok [http::geturl
  http::cleanup $tok
  set x [expr {abs(int(rand()*100000))}]
  for {set i 0} {$i<20000000} {incr i} {
    set x [expr {$x+1}]
  }
  wapp-trim {
    <h1>Slow page</h1>
    <p>x = %html($x)</p>
  }
}
wapp-start $argv