It’s a fire hazard to charge overnight. If you’re asleep you may not notice a fire soon enough. I’m not saying it’s a big risk, just that it could be considered.
It can be a fire hazard if you are the type of person who falls asleep with their phone under a pillow, under a heating blanket or in some sort of environment where there is limited air flow.
I assume you are speaking of Apple's recent document on this. If so, you'll notice that they are specific in mentioning air flow.
My iPhone sits in a wire metal business card holder (which means the holder is ventilated) on top of a glass desk approximately three feet from my bed. The phone is in the path of the air conditioner.
The presence or absence of sunlight has nothing to do with it. Suddenly, because night comes it's a fire hazard? What about people charging during the day? Is it NOT a fire hazard because they chose to do it in the day?
What about people working nights in an office? Is it a fire hazard to charge your phone at your desk when your work shift is 8pm to 5am?
Sorry, this makes zero sense.