Let's break the condition for "sunIsVisible" down to it's core elements:
if(!worldObj.isDaytime() || worldObj.worldProvider.hasNoSky || !worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || !(worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord) instanceof BiomeGenDesert) && (worldObj.isRaining() || worldObj.getIsThundering()))
First, we need to know the values of the world you are in...
!isDayTime = False
hasNoSky = False
!canBlockSeeTheSky = False (Assuming you have done this right, and it is NOT can see sky )
!(getBiomeGenAt(xCoord, zCoord) instanceof BiomeGenDesert) = False (This is, Are you NOT in a desert biome)
isRaining = True (Rain is global, you just don't see it visually in a desert)
getIsThundering = False (You never mentioned anything about thunder)
So now, the if statement becomes:
if(False || False || False || False && True || False)
Because of precedence we evaluate the "False && True" statement first... Which is False and thus we get:
if(False || False || False || False || False)
So, there is no logical reason (in code) as to why your solar panel shouldn't produce energy using the conditions you specified.
However, if there is thunder then the compressed statement becomes:
if(False || False || False || False || True)
In which case your generator will not produce power. (Thunder in a desert biome is a sand storm i assume? Never experienced thunder in the desert before)
So maybe you walked into another biome but never heard or saw thunder?
EDIT:
AHA! After some additional checking, isDayTime is directly related to the subtractedSkyLight value. When it's raining and/or thundering the light level drops (and as such the subtractedSkyLight value increases) and if the subtractedSkyLight value is greater than 3 then isDayTime becomes false. (Thus making !isDayTime evaluate to true)