Glad you figured it out! Since you said you didn’t know what caused the problem, based on your screenshot it looks like you have your fog disabled in the viewport but enabled in the render as denoted by the grayed out eye-closed icon:

In fact I recommended doing this in the course to keep your viewport optimized. Hopefully that clarifies the situation!