Displacement activity is a term in ethology, that refers to behaviour patterns which appear to be out of context in relation to behaviours that come before and after. An example of this is domestic fowl pecking at the ground whilst engaged in fighting.
In human cases, behaviours such as scratching one’s head when confused are considered to be a displacement activity.
Immelmann K., Beer C. (1992) “A Dictionary of Ethology” (pp. 101-111). Harvard University Press, Cambridge