ERR is a reserved QB error code variable. ERR = 9 is subscript out of range. What that code you posted from a manual looks like is, well, possibly part of a larger snippet, not included, which would have a RESUME statement, after the error is handled in the main (and of course that code not shown would also have to make that error handler in the main) Then, as you say, I agree, that ON ERR GOTO is exactly like ON GOTO or the ON GOSUB statements.
I cannot recall ever being able to place an error handler in a sub or function. You could put them in the main of each "module" in a multi-modular program.
Pete