Regarding pensioners, the main reason for the tax code errors was HMRC's failure to reduce the over 65 personal allowance of £9300 by £1 for every £2 for income above £22300 until it dropped to the standard single personal allowance of £6300. For someone earning £37k this results in an underpayment of £900 p.a. Robber Brown's ever increasing and devious small print rules must take a lot of the blame.
This error is covered by Statutory Notice 19.
(My figures are rounded down or up for simplicity)