David says the sun runs its course from one end of the heavens to the other, and nothing is deprived of its warmth. And Jesus says God causes the sun to rise on the evil and the good alike.
But Job, who speaks the truth about God, says God speaks to the sun and it does not shine. So everything must be deprived of the warmth of the sun when he does that. And when God speaks to Job later, he says the wicked are denied light.
David, contradicting his own previous claim, acknowledges that a stillborn child never sees the sun. And his son Solomon mentions the same thing.
Isaiah says when God punishes a land, all you can see is darkness, because even the sun is darkened by clouds. So a land being punished by God would be deprived of the sun. Like Israel, for example, for which God said he would make the sun go down at noon and darken the earth in broad daylight. Whatever that means. Or like Judah, for which God also said the sun would set while it was still day. Or Egypt, for which God said he would cover the sun with a cloud.
God told the prophet Micah to tell Israel that the prophets of Israel were corrupt, so the sun was going to set for the prophets, and the day would go dark for them. This means that, contrary to what Jesus claimed, God does not give sunlight to the evil.
And one time when Paul was traveling on a ship, there was such a raging storm that the crew couldn’t see the sun for many days, and they gave up hope.