Somehow I think the following lines are more correct for constructing components:
USphereComponent* SphereComponent = CreateDefaultSubobject<USphereComponent>(TEXT(“RootComponent”));
RootComponent = SphereComponent;
or
UStaticMeshComponent* SphereVisual = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(“VisualRepresentation”));
SphereVisual->AttachTo(RootComponent);
They’re according to this official tutorial.