I don't know about pain, but it really affects their sight. The way their eyes are oriented only allows them to see up, and their depth perception is awful. Their eyes are also very easily injured, you have to be careful what you put in a tank with them
Having eyes on the top of your head can be advantageous... if you're a bottom dwelling species. Goldfish aren't, really, from what I remember. Plus, that one fish is not evn looking up-- it literally is staring more or less into it's own other eye, constantly. If it sounds like it could be an episode of black mirror, it's not something an animal should have to go through.
That said, you really don't want to start digging into the rabbit hole of the pet fish market. A lot of what goes on-- largely because of ignorant owners and suppliers who are in it for the money-- has absolutely nothing to do with giving these animals a proper quality of life
Some fish supplies inject their young fish with a chemical that makes them show adult vibrant color a lot earlier but usually kills them fairly soon after. They don't care because they know it will already have been sold by that point and no longer their problem
That said, you really don't want to start digging into the rabbit hole of the pet fish market. A lot of what goes on-- largely because of ignorant owners and suppliers who are in it for the money-- has absolutely nothing to do with giving these animals a proper quality of life