Sunlight with suncalc tool. I have a issue to set the sun position coordinates

I’m working on a small Three.js project that requires realistic sunlight simulation based on the sun’s position throughout the day. My application needs to adhere to specific versions of dependencies defined in my package.json, which I cannot alter.

I’ve integrated SKY from DREI, and it generally functions correctly. However, I encounter a problem when setting the sun’s position using real-world solar data. I’m using suncalc.org to obtain the sun’s altitude and azimuth for San Francisco at 8 am PST, which is Altitude: 10.30° and Azimuth: 94.72°. The issue arises when I attempt to update the sun’s position to 11 am; the sun seems to vanish from the scene entirely.

Could there be a problem with how I’m applying the altitude and azimuth values in DREI? Or might there be an issue with the way the rendering engine processes these coordinates? The goal is to create a dynamic lighting environment that adjusts the directional and point lights based on the sun’s position, allowing for accurate shadow casting.

Here is a snippet of the code where I’m setting the sun’s position :
Codesandbox