Class components get displaced by a random amount when dropped in the world

Hello,

I have made a CPP class where I have added a collision box as root and static mesh component as child. Then I have created a Blueprint based on the CPP class. However, when I try to drag and drop the blueprint into the world, the static mesh component (or any child component) seems to get offset by a random amount of location.

In the screenshot given below, the right window is what the class blueprint looks like. Notice that the static mesh is set at (0,0,0) relative location. On the left is what it looks like after i drag the blueprint in the world. The static mesh has simply displaced by a random amount.

Here is my code
// Header File
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

//Initialize Collision
UPROPERTY (EditAnywhere, Category = "Ship Properties")
UShapeComponent* ShipCollision;

//Initialize Static Mesh
UPROPERTY(VisibleAnywhere, Category = "Ship Properties")
UStaticMeshComponent* ShipMesh;

UPROPERTY(EditAnywhere, Category = "Ship Properties")
float ShipSpeed = 10.0f;

//CPP File
AGalacticLegendShip::AGalacticLegendShip()
{
 	// Set this pawn to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;
	
	ShipCollision = CreateDefaultSubobject<UBoxComponent>(TEXT("Root"));
	ShipCollision->SetGenerateOverlapEvents(true);

	ShipMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("ShipMesh"));
	ShipMesh->AttachToComponent(ShipCollision, FAttachmentTransformRules::KeepRelativeTransform);

	//Possess ship pawn at game start
	AutoPossessPlayer = EAutoReceiveInput::Player0;

}

Hi
I’m having this exact same issue with arrow components. Did u manage to solve the problem, if so how?