You’ll need to create another camera try this and I’ll tell you why if this works for you.
Add a new camera let’s name it MyCamera2
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
class UCameraComponent* MyCamera2;
Now in your constructor add this code:
MyCamera2 = CreateDefaultSubobject<UCameraComponent>(TEXT("MyCamera2"));
MyCamera2 ->SetupAttachment(GetMesh(), SocketName);
Compile your code and see if MyCamera2 is attached to the head as it should be.