Another comment first. On your mesh, go into edit mode, select all, and press Ctrl-N>Recalculate Normals Outside. That will take care of the black artifacts on your mesh.
The problem in some cases (like the neck, back of head) is that not all vertices are properly weighted to the bones. Probably you did this by weight painting and the necessary verts were concealed by other parts of the mesh, so they couldn’t be painted.
You can do a couple things. One thing you can do is to put the verts manually in the appropriate bone vert groups, in edit mode select the verts that need to be influenced by the bone, and in Vertex Groups click “assign” with a value of one to the appropriate bone group. You can select sections of the mesh by pressing the L key with the mouse over their verts in edit mode, then assign the whole segment to a bone in the vertex groups area. Then invert the selection and remove all other verts from that bone.
For a mechanical thing like this, you don’t want any actual mesh deformation, though, so you also could model the robot with separate parts in individual objects and use bone parenting. Go into pose mode, then select the object (you will automatically return to object mode), then select the armature (which will still be in pose mode) then select the bone and press Ctrl-P>parent to bone. This is just a different way to do it.
The important thing is to make sure that all the necessary verts are being influenced by the appropriate bone.