(theoretically) valid cast failed

So basically I am trying to load a widget from an UGC package. But when I try to cast the widgetclass to its superclass, the cast just returns NULL.

relevant cpp code excerpt:

for (FUGCPackage& package : UGCRegistry->UGCPackages) {
	TArray<UClass*> Classes;
	UGCRegistry->GetAllClassesInPackage(package, Classes);

	for (UClass* currentClass : Classes) {
		if (currentClass->IsChildOf(UAppIconSuperclass::StaticClass())) {
			if ("appIcon_C" == UKismetSystemLibrary::GetClassDisplayName(currentClass)) {

				if (Cast<UAppIconSuperclass>(currentClass) != NULL) {
					GEngine->AddOnScreenDebugMessage(-1, 100, FColor::Green, "valid"); // doesn't print -> cast failed
				}
				if (currentClass) {
					GEngine->AddOnScreenDebugMessage(-1, 100, FColor::Green, "was valid"); // does print -> class is valid
				}

I know that the class has got UAppIconSuperclass as parent, and first if check let’s it through, so why does the cast fail? I also tried to cast to UUserWidget (parent class of UAppIconSuperclass) - with the same result…

Is anyone able to help me and tell me what I am doing wrong / why it wouldn’t cast correctly?

Hello! currentClass is UClass, not UAppIconSuperclass child!

but currentClass->GetSuperClass()->GetName() returns AppIconSuperclass. so why is it just a UClass now and how would I change that / make it work?

nvmd. solved it myself