Sphexism is the common name for the mental condition
of sphexishness, named after the sphex wasp
The sphex wasp shows unusually inflexible behaviour. When it stings its victim (for instance, a spider) to paralyse it, it will drag the paralysed victim to a burrow, and then go inside to prepare for a feast before returning to carry the spider below.
The interesting part is this: if, while the wasp is gone, you move the victim spider by even a few millimetres, when the wasp returns it will drag the spider back to where it left it, and then go back underneath to check on affairs. If you move it again, the wasp will repeat the pattern.
The term sphexishness is also applied to certain obsessive-compulsive behaviours in humans, e.g. when someone goes to leave the house, but worries that they have left the gas on, and goes to check, and then goes back to the front door, worries that they have left the gas on, and so on, ad infinitum. No matter what input the nervous system receives, it always produces the same output.