How to copy value of UProperty in C++

Trying to implement simple function that returns value of an array element like if array was looped, for example if I ask for an element that is 5 positions after the 7th in array of 10 elements in total, it should return the second one, etc.
Want to make it working with different types, so I could pass any array in it, but having the next issue: if I copy an element to output parameter, It gives me a garbage or smth in BP, like if I was dereferencing wrong address.
Tell me please, how do I copy value of UProperty? Also, for some reason I can’t use FProperty, module won’t build if I do that, at the same time UProperty macro works fine… would be nice if someone can explain to me this moment too.

Here is .h

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "CppUtils.generated.h"

/**
 * 
 */
UCLASS()
class PRISMATTER_API UCppUtils : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

	UFUNCTION(BlueprintPure, meta = (CompactNodeTitle = "Next Looped", ArrayParm = "array", ArrayTypeDependentParams = "item", BlueprintThreadSafe), Category = "Utils")
		static void GetNextLoopedArrayElem(const TArray<UProperty*>& array, int nextTo, UProperty*& item, int offset = 1);
};

and .cpp

#include "CppUtils.h"

void UCppUtils::GetNextLoopedArrayElem(const TArray<UProperty*>& array, const int nextTo, UProperty*& item, const int offset)
{
	int newIdx = nextTo + offset;
	while (newIdx < 0)
	{
		newIdx += array.Num();
	}
	newIdx %= array.Num(); 
	item = array[newIdx];
}

How do you read those properties? Note that UProperty is just identifier of property inside UClass or UStruct, you still need object to read property.

Honestly, I don’t have any clue what are you talking about except for the fact it’s all happening inside a widget… May it be solution to my problem, am I supposed to use some other type for array, not the UProperty? I simply need to be able to pass any array into this function and get it’s element at the specific index, just like built in GET function. It needs to look somewhat like this

341272-безымянныи.png