Throw diagnostic if records() is asked for an out-of-range record.