USpringArmComponent::SocketName is static. It’s not really a “Socket” in the sense of static mesh/skeletal mesh sockets, you can look at the spring arm source to see how it’s used.
You can’t do the same for meshes, because the mesh will be null at the time of construction for the class-default object, it’s just an empty component with no mesh unless you also force a default mesh (which is a terrible idea). If you want to attach to sockets, you can wrap that code with something that protects against the CDO, such as:
For some reason the SpringArmComponent actually just returns the end-of-arm position for all sockets, even the “None” one - so anything attached to it even if not using the static SocketName presumably is treated as if it was attached via the socket anyway.