There seems to be a bug with script functions passed into a function using a ?& in parameter. The object type for this returned by asIScriptEngine::GetObjectTypeById returns -1 as the type id (asIObjectType::GetTypeId).
While the type id is already available, it would be nice if this method returned the same type id.