If you have
UCLASS()
class UMyComponent : public UActorComponent
{
public:
TArray<type> mArray;
}
then you need to cast to UMyComponent* as UActorComponent* does not now the variables created in UMyComponent.
If you know how to do casting with reflected types, why you think it is not working in a function library?
just
UActorComponent* needsCast;
UMyComponent* comp = Cast<UMyComponent>(needsCast);