Have you tried changing the position of the parent spring arm, instead of the camera? Issues could arise between parent/child.
Since you are attempting to change the relative location of the camera, as it is a child of an object that will be moving relatively, you should be changing the component’s relative location, not world location. You can convert the socket location from world to local space, then use that to set your relative location. I’d assume rotation is already controlled by player input, so that shouldn’t need to be set - otherwise you can set it to the gun’s rotation. Hopefully this helps!