It looks like a recent macOS update broke support for wallpaper directories. For example, running
setwp --interval=10 <directory>
results in a black background and the Dock application being unable to restart. (Running setwp again with a single wallpaper will allow the dock to restart.)
After some investigation, I found out that it's now required to set a current wallpaper as well as the directory. So this will require selecting a picture from the given directory and setting the Current preference (see pref.Current).