Why HMC5883L error?

Where did you get the code from - the one I found looks OK, perhaps you have a different version?

setScale() seems to do the obvious thing - look at what your version is doing?