Hey Marta, you should be able to zoom in on the screenshot to be able to read it. Otherwise, I would not have posted it. I was also able to figure out the problem. In the first part of the task it sets a black background. The second part of the task restores the original background. You cannot switch the wallpaper twice without having "refreshed" the homepage (turned off the screen and then turned it back on or going into an app and then going back to the homescreen). I corrected this by having the task launch and app and then close it right after after the wallpaper had been changed. Even though I already solved the problem I appreciate your response, Marta. Also, I will add the code if anyone is curious.
Night Mode (70)
A1: If [ %Nightmode ~ 0 ]
A2: Secure Settings [ Configuration:Airplane Mode Radios: Cell, Bluetooth, NFC, WiMax Timeout (Seconds):0 ]
A3: Secure Settings [ Configuration:Airplane Mode Enabled Timeout (Seconds):0 ]
A4: Set Wallpaper [ Image:Download/pure-black-wallpaper-159.jpg Scale:Off Crop:Off ]
A5: Java Function [ Return:(AudioManager) audio_manager Class Or Object:CONTEXT Function:getSystemService
{Object} (String) Param:"audio" Param: Param: Param: Param: Param: Param: ]
A6: Java Function [ Return: Class Or Object:audio_manager Function:setRingerMode
{} (int) Param:0 Param: Param: Param: Param: Param: Param: ]
A7: Media Volume [ Level:0 Display:Off Sound:Off ]
A8: Notification Volume [ Level:0 Display:Off Sound:Off ]
A9: Haptic Feedback [ Set:Off ]
A10: System Volume [ Level:0 Display:Off Sound:Off ]
A11: Display Brightness [ Level:0 Disable Safeguard:On Ignore Current Level:Off Immediate Effect:Off ]
A12: If [ %WIFI ~ off ]
A13: WiFi [ Set:On ]
A14: End If
A15: Variable Set [ Name:%Nightmode To:1 Do Maths:Off Append:Off ]
A16: Launch App [ App:Tasker Data: Exclude From Recent Apps:Off Always Start New Copy:Off ]
A17: Wait [ MS:500 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A18: Go Home [ Page:0 ]
A19: WiFi Calling Controls [ Configuration:On Timeout (Seconds):0 ]
A20: Flash [ Text:Night mode enabled Long:Off ]
A21: Else If [ %Nightmode ~ 1 ]
A22: Secure Settings [ Configuration:Airplane Mode Disabled Timeout (Seconds):0 ]
A23: Secure Settings [ Configuration:Airplane Mode Radios: Cell, Bluetooth, NFC, WiFi, WiMax Timeout (Seconds):0 ]
A24: Haptic Feedback [ Set:On ]
A25: Java Function [ Return:(AudioManager) audio_manager Class Or Object:CONTEXT Function:getSystemService
{Object} (String) Param:"audio" Param: Param: Param: Param: Param: Param: ]
A26: Java Function [ Return: Class Or Object:audio_manager Function:setRingerMode
{} (int) Param:2 Param: Param: Param: Param: Param: Param: ]
A27: Variable Set [ Name:%Nightmode To:0 Do Maths:Off Append:Off ]
A28: System Volume [ Level:7 Display:Off Sound:Off ]
A29: Media Volume [ Level:7 Display:Off Sound:Off ]
A30: Set Wallpaper [ Image:Pictures/Wallpapers/-1921611128.jpg Scale:Off Crop:Off ]
A31: Display Brightness [ Level:20 Disable Safeguard:Off Ignore Current Level:Off Immediate Effect:Off ]
A32: WiFi Calling Controls [ Configuration:Off Timeout (Seconds):0 ]
A33: Flash [ Text:Night mode disabled Long:Off ]
A34: End If