Looks like it's just an optimization. If you change to
let test_curry x y = x + y + x
You get the expected output function f(param) {
return test_curry(32, param);
}