how to fix pupils (nodes)
Actually the problem is that you're deforming the object in 3D. The material setup, that works fine for a 2D object, will deform in 3D. You could fix that with the Mapping node, but as you want to animate the pupil, you need to find another solution, because animating with the Mapping node would be a bit tedious.
A quick way to do it is to create an empty, parent it to the head and give your Texture Coordinate the empty as Object:

Now when you move the empty the pupil follows. You can give it a Limit Location constraint (Local Space mode) so that it sticks around the eye area when you manipulate it:


A more accurate solution would be to give your eye an Image Texture and move the texture with the UV Warp modifier, see video here or Blender Stack Exchange answer here.