I don't know what the index of refraction is for space, but it's got to be very very close to 1. We can typically approximate air as having an index of refraction of 1, but a more accurate number is 1.000277 (at STP). Most of the matter in space is hydrogen, which has an index of refraction of 1.000132 at STP. Since the density in space is less than one trillionth (10^{–12} of that at STP, I think a simple approximation of the index of refraction of interstellar space as 1.000000000000000132. Even if the density of space were to vary by more than six orders of magnitude (one million times) at some sort of interface (remember the light deflection has to do with changes in refractive index, not the index itself) using Snell's law for an interface between R = 1.000000000000000132 to R = 1.000000000132, I calculate a deflection of a beam of light with incidence angle of 45° is 45.0000000076°. The error between 45° and 45.0000000076° would be about 1000 km for every lightyear that the beam has traveled to the interface that distorted it, which might sound like a large number, but bear in mind that is 0.14% of the Sun's radius so this imaginary interface would have to be 700 light years from the sun for the observer to accidentally think the Sun is somewhere that doesn't overlap with where it actually is. Also bear in mind that this kind of distortion would have very little effect on the observations of anything the size of a solar system or stellar cluster (ie each object in the system would have the same error, so the effects would cancel out when looking at distances and interactions between the objects).