What makes you think that this procedure returns the current difficulty? The page says pretty clearly that it returns the average number of hashes required to solve a block.
Or are you just forgetting to divide by 232 to convert hashes to difficulty?