The 3D Viewport doesn’t give me any information; you already told us that it was black 😉
And the Shader Editor doesn’t show the Fog…
But if it is sometimes black and sometimes clear, then my guess would be that it is your Graphics driver (that is not up to date).