I solved the "mystery" now. I had completely forgotten that
Dexpot (a free utility for virtual desktops) is running on my PC.

On Windows startup, in rare cases my wallpaper program was launched
after Dexpot and everything was fine. But in most cases, on Windows startup
at first my wallpaper program was launched, and it changed the desktop wallpaper as it should. But then Dexpot was launched, and it changed the desktop wallpaper again, according to its own settings.

The solution simply was to change the Dexpot settings, so that it also uses the bitmap file created by my program as desktop wallpaper. Maybe this report helps someone else to avoid a similar issue.
Regards, Little John