When I have a ref and I want to cast<> it to a usable type to work with, I can only successfully cast<> to the type that was assigned to the ref and not necessarily something within the class hierarchy of what was assigned to ref. That is, if I stored a handle to an application-registered derived class, casting to the base class fails.
UPDATE: I see there's a TODO in CScriptHandle::Cast().