The reason your code returns the nil method is because the type of the object does not contain a method called SomeHelper . The type that this method contains is a helper type.
So you can write this which will return the non-nil method:
obj:=TSampleClass.Create; rtype:=ctx.GetType(TypeInfo(TSampleClassHelper)); rmethod:=rtype.GetMethod('SomeHelper');
Of course, you should immediately see the first problem, namely, use the compile time type, TSampleClassHelper . Can we use RTTI to detect TSampleClassHelper at runtime depending on the type of instance? No, we cannot, as I explain below.
Even if we put it in one direction, as far as I can see, there is no way to call a method using RTTI. If you call rmethod.Invoke(obj, []) , then the code in TRttiInstanceMethodEx.DispatchInvoke blocks the attempt to call the helper method. It blocks it because it indicates that the instance type is incompatible with the method class. Relevant Code:
if (cls <> nil) and not cls.InheritsFrom(TRttiInstanceType(Parent).MetaclassType) then raise EInvalidCast.CreateRes(@SInvalidCast);
Well, you can get the address of the helper method code using rmethod.CodeAddress , but you will need to find another way to call this method. It is easy enough to pass it to a method with the appropriate signature and call it. But why bother with rmethod.CodeAddress ? Why not use TSomeHelperClass.SomeMethod and cut the RTTI out of the loop?
Discussion
Helper resolution is statically based on the active helper at the compilation point. When you try to call a helper method using RTTI, there is no active helper. You have completed the compilation long ago. Therefore, you need to decide which helper class to use. You do not need RTTI at this moment.
The main problem here is that solving the helper method class is basically a static process executed using the compiler context. Since there is no compiler context at runtime, method resolution of a class helper class cannot be performed using RTTI.
For more information on this, read Allen Bauer here: Find all class helpers in Delphi at runtime using RTTI?