Sort of fixed/bodged it myself.

Seems that one of my #Ref1 numbers was formatted slightly differently. So I converted the column to text, padded it out with zeros and pasted the values over the top and that seemed to fix it.