An alternative method you can try.
Run in terminal:
xfconf-query -c xfce4-desktop -m
With the terminal open, change the wallpaper of the desktop using right-click on desktop > Desktop Settings…
See the output of changing the wallpaper in the terminal (for me it was /backdrop/screen0/monitor0/workspace0/last-image
).
Copy the output and replace it in the following command:
xfconf-query -c xfce4-desktop \
-p /backdrop/screen0/monitor0/workspace0/last-image \
-s "/path_to_the_image/<name_of_the_image>.jpg"
Finally, change the path to the image in the last command and test it. If it’s working, you can use it in your script.