I didn't find a solution, but i did find a work around
It turns out that it was the array brackets '[ ]' in the printf statement that seem to cause the problem.
The work around is printing to file the old fashioned way using a loop
idx = uniq(starId)
openw,2,'/filepath/uniqlist.txt'
for i = 0, n_elements(idx)-1 do begin
printf,2, starId[idx[i]],' ',RA[idx[i]],' ',DEC[idx[i]],
endfor
close, 2
Not ideal, but it does work.
I would still be interested in a better solution if someone has one.