Individuals differ in sensitivity to the adverse consequences of their actions, leading some to persist in maladaptive behaviours. Two pathways have been identified for this insensitivity: a motivational pathway based on reward valuation and a behavioural pathway based on stimulus–response mechanisms. Here we identify a third, cognitive pathway based on differences in punishment knowledge. Exposed to identical punishment contingencies, some people (Sensitive) form correct causal beliefs that guide their behaviour to avoid punishment, whereas others form incorrect causal beliefs that lead them to earn punishment. Incorrect causal beliefs were not inherently problematic, many individuals benefited from information about why punishment was occurring, revaluing their actions and changing their behaviour (Unaware). However, we identify one condition where incorrect causal beliefs can be problematic: when punishment is infrequent. Under this condition, more individuals showed detrimental patterns of behaviour that resisted information-driven updating (Compulsive). For these individuals, rare punishment inoculated behavioural preferences against cognitive and behavioural updating.