In the dark, fish usually do not swim upright, but more or less at an angle. As soon as the aquarium light goes on, they swim upright again.
Most fish always turn their backs to the side where the light is coming from. Because of their swim bladder, they practically float in the water. Because of this, gravity does not affect them as much and they are practically weightless.
The Pisces align themselves with the light because the light of the sun and moon in nature almost always comes from above.
If some light falls into the aquarium from the side in the dark, for example from a table lamp, the fish align themselves accordingly and swim at an angle accordingly.
If the bottom is very light so that the light is strongly reflected, the fish can even swim upside down.
Deep-sea fish and other fish from areas where no solar radiation penetrates have a special sense organ for orientation.