If the Earth is flat, then the Sun would have been visible from the entire Earth, but that’s not the reality. So, to rescue the concept of the flat-Earth from being falsified, they invented an ad-hoc hypothesis that the Sun appears to set because of perspective and refraction.
Light waves are not always moving in a straight line. When it passes through a medium of a different refractive index, the waves will deviate. The phenomenon is called refraction and described according to Snell’s Law.
Earth’s atmosphere has variation in air density that depends on the altitude. As the refractive index changes with the density of the medium, light waves passing through Earth’s atmosphere also experience refraction.
Sometimes, we can see clouds appearing as if they are behind the Sun or the Moon. Obviously, this is merely an illusion. But some flat-Earthers regard this as ‘evidence’ that the Sun and the Moon are close and apparently closer than some clouds. They are wrong.
Some flat-Earthers consider crepuscular rays as evidence that the Sun is not far. In their mind, the Sun is only about ±5000 km circling above us. In reality, the actual distance of the Sun is ±150 million km.