Hey I had this exact problem when working with attach to a socket in C++ if you didn’t have everything setup properly the first time then it won’t work when you try to attach to a socket, if you’re doing this in the constructor then you probably want to remove that camera and add another one or at least change the variable name otherwise no matter what you do the changes will not take effect, if it is in the constructor use MyCamera->SetupAttachment(GetMesh(), SocketName);
For now add a new camera and attach to the head socket and compile.