Instanced classes don't work on components added using `CreateDefaultSubobject`

I have a component with a TArray of instanced objects. When I add the component to a blueprint in the editor I can add instanced objects to the array and edit the defaults of the objects without any problems. But when I add the component to a native actor class using CreateDefaultSubobject I can no longer add the instanced objects to the array. I can still add new members with the None value to the array, but selecting a class from the dropdown no longer changes the value of the member.

2022-10-21 10-33-45 (1)

Steps to reproduce:

  • Create a new project
  • Add “AIModule” to the project’s Build.cs public dependencies
  • Create an actor in C++ and add the UAIPerceptionComponent in the constructor using CreateDefaultSubobject
  • Build an run the editor
  • Inherit a blueprint from the C++ actor class
  • Try to add instanced UAISenseConfig objects to the Senses Config array in the perception component

	// Sets default values for this actor's properties

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
	class UAIPerceptionComponent* perceptionDebug = nullptr; // <- component

	// Called every frame
	virtual void Tick(float DeltaTime) override;
#include "TESTACTOR.h"

#include "Perception/AIPerceptionComponent.h"

// Sets default values
	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	perceptionDebug = CreateDefaultSubobject<UAIPerceptionComponent>(TEXT("Perception DEBUG")); // <- Adds the component

// Called when the game starts or when spawned
void ATESTACTOR::BeginPlay()

// Called every frame
void ATESTACTOR::Tick(float DeltaTime)

In my experience instanced objects tend to expose bugs and shortcomings in the UObject system and editor UI, especially when mixed with components. Hopefully Epic can fix this one.

I have also this problem too.
I have a class marked as EditInlineNew and an array of pointers to that class marked as Instanced in a class derived from ActorComponent. When I construct the component object using CreateDefaultSubobject, I’m not able to set object instanced in the array as shown in the first post. Any attempt to choose any class from the dropdown will result in the ‘None’ being selected.
Don’t know if this is fixed in 5.1 or not.