I think I know what's going on, getCallable() doesn't check for the storage class of a function, and does a cast based on the parameters and the return type when it's adding a new handler. The handler is later casted to a function type with no ref parameters, and this is where things probably cause problems.
I'll have to devise something more sophisticated.