What are the best practices for displaying the list of components in an actor in the detail window?

I want the components in blueprint actor to be the value of a combo box in the detail panel, what is the best practice for getting a list of components in an actor?

Environment

OS : Windows11
Engine : UE 5.2.1

Background

I have created a Component(named ObjectLayouterComponent) that aligns WidgetComponent and StaticMeshComponent with each other.
This component has WidgetComponent and StaticMeshComponent in the same actor as parameters.

I thought it would be less work to specify the parameters to this component in the detail panel rather than in the blueprint, so I tried to create a slate combo box for detail panel to select the components in the actor.

What I tried - 1

At first, I was going to get the owner actor from Component and then the list of components.
(Note: ObjectLayouterComponentEditor is a derived class from IDetailCustomization for customizing the ObjectLayouterComponent detail panel)

void ObjectLayouterComponentEditor::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
{
  const TArray<TWeakObjectPtr<UObject>>& selectedObjects = DetailBuilder.GetDetailsView()->GetSelectedObjects();

  selectedObjects[0]->GetOwner()->GetComponents(_sceneComponents, true); // _sceneComponents is a TArray<SceneComponents*> to display in the combo box
  ...
}

However, when the game was not running, the owner of the Component was null.

The following image shows the status of ObjectLayoutComponent from VisualStudio after clicking ObjectLayoutComponent in the component list of the Blueprint Editor while the game is not running.
You can see that Owner is Null.
(Note: You can’t see it in the code, but uobject is set to the value of ObjectLayouterComponent* stored in DetailBuilder.GetDetailsView()->GetSelectedObjects() )

スクリーンショット (281)

What I tried - 2

So I did a lot of research and wrote the following code.

void ObjectLayouterComponentEditor::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
{
  UE_LOG(WidgetFrameLayouterEditor, Verbose, TEXT("ObjectLayouterComponentEditor::CustomizeDetails() --------"));

  const TArray<TWeakObjectPtr<UObject>>& selectedObjects = DetailBuilder.GetDetailsView()->GetSelectedObjects();

  UObject* outer = selectedObjects[0]->GetOuter();
  UBlueprintGeneratedClass* bp_gen = Cast<UBlueprintGeneratedClass>(outer);
  if (bp_gen)
  {
    _sceneComponents.Reset();
    const TArray<USCS_Node*> nodes = bp_gen->SimpleConstructionScript->GetAllNodes();
    for (auto node : nodes)
    {
      if (!node) continue;

      USceneComponent* scene_comp = Cast<USceneComponent>(node->ComponentTemplate);
      if (!scene_comp) continue;

      _sceneComponents.Add(scene_comp);

      UE_LOG(WidgetFrameLayouterEditor, Verbose, TEXT("  scene component : %s"), *(scene_comp->GetName()));
    }
  }
  ...
}
--- log ---
WidgetFrameLayouterEditor: Verbose: ObjectLayouterComponentEditor::CustomizeDetails() --------
WidgetFrameLayouterEditor: Verbose:   node component : DefaultSceneRoot_GEN_VARIABLE
WidgetFrameLayouterEditor: Verbose:   node component : WidgetComponent_GEN_VARIABLE
WidgetFrameLayouterEditor: Verbose:   node component : StaticMeshComponent_GEN_VARIABLE
WidgetFrameLayouterEditor: Verbose:   node component : ObjectLayouterComponentABC_GEN_VARIABLE

This code is working correctly for now, but I am not sure if it is really correct or not.
And I also feel that this code is too long to get a list of components and would like to know a shorter code.

Does anyone know of a best practice for getting a list of components in an actor without the game running?

Also, I actually do not know why this code works from a in the context of architecture. If you have a documents that explains the architectural relationships between IDetailLayoutBuilder, UBlueprintGeneratedClass, SimpleConstructionScript, and USCS_Node, please let me know that too.