[netcore] Update the checks for ByRef return type in reflection invocation (#14967)