The problem is returning a closure that points to a stack variable that's now out of scope.
Your comment makes no sense. OP stated that your hypothetical problem isn't even a problem if the developer knows what he is doing, and your take from that is that there are more problems?