Hey there!
So by Default AttachToActor and AttachToComponent take an optional last parameter called SocketName. So all you should need to do here is HoldingComponent->AttachToComponent(GetMesh(), FAttachmentTransformRules(EAttachmentRule::SnapToTarget, true), TEXT("Hand"));, and unless there are other issues in your code, that should be it I believe 
Also, to give a bit more explanation: GetMesh()->GetSocketByName("Hand") is actually returning some metadata about the Socket on that mesh (if it exists), and from what I’ve seen glancing at the source is mainly used in the Editor, not at runtime (though this may be incorrect).
Hope this helps!