In my experience, attaching to sockets never really properly worked in the constructor for some reason.
Try setting up attachment in either OnConstruction() or BeginPlay() instead.
How do you know if itās not attached? Remember that sometimes properties declared in C++ are not visible in Blueprints.
Try to change your UPROPERTY(EditAnywhere) to UPROPERTY(EditAnywhere, BlueprintReadWrite) to visualize it on editor.
Are you sure āGetMesh()ā is initialized by the time you set up attachments to it?
May be something to confirm.
I used SetRelativeLocation to adjust the component position before using AttachToComponent.
For me that worked better than snapping.
You can either use SnapToTarget AttachmentTransformRule if it works for you as is, or use SetRelativeLocation to first adjust the position of the component to attach on spawn and then use the keep relative attachmenttransformrule.