That’s because functions with record (and other structured) return types are really implemented as hidden var-parameters.
IMO, they should have been implemented as out-params, to get proper warnings. Alas, functions returning structured types preceded support for out-parameters (IIRC), and they never went back to fix this.