The only difference is that a space (converted to %20 in the URL) is used in the last URL, but the result seems to be different regions? This only happens when the total amount of characters are 7 and not 6 (with 6 it all seems fine).
GeoNames has only the first part of the UK postal codes. If the postal code is longer then the part after the blank is cut (example 2). If no blank is within the code then the first three letters are used.
Maybe it would be better to cut after four letters it the total number of letter is 7. What do you think?