Cannot cast BP child of a C++ UObject derived class to that class?

The setup:
I have a base class…

UCLASS(Blueprintable) // tried with just UCLASS(), BlueprintType... nothing changed
class UExtraData : public UObject
{
	GENERATED_UCLASS_BODY()
public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Testing")
	FString ExtraDataType = "ExtraDataBase";
};

… that I want to use as a basis for an easily extensible system (the likes of which are child’s play in pure C++, but this needs to be extensible without needing to touch a single line of code in any way), where there can be various different kinds of data and the code/BP will decide what to do with them based on what their class is.

My Actor and/or DataAsset has a…

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Extra Data")
	UObject* data = nullptr;

… property that can be assigned in the editor, with items from the content browser (and I’d like to not limit myself to UExtraData children, so that if I just drag in a SoundCue for example, I can cast for that and handle it).

The idea was to have blueprint children of the UExtraData class that contained the various different kinds of data needed (BP_Data_Quests, BP_Data_Animations, etc, etc), but I’ve run into a maddening snag.

I can’t seem to cast the contents of data to UExtraData (either in a blueprint or in a c++ BP function), since I seem to deadend at UBlueprint every time…

I have a couple of ideas as to why this might be, but my main thought seems to be that it’s because the UObjects don’t actually “exist” in the world, maybe? (Because casting actual actors to their respective parent classes seems to be working without problems)

I could however be wrong, and would be incredibly grateful if someone could point out the (hopefully) simple oversight here.

In case anyone else ever ends up here, here’s the answer, thanks to @_crnobog

if (UBlueprint* BP = Cast<UBlueprint>(data))
{
	return BP->GeneratedClass->GetDefaultObject<UObject>();
}
else
	return inData;