Meanwhile, I was able to fix the issue. You have to get Kodi into a state where it asks again for the password of the smb share. In this dialogue, you have the option to let Kodi save the password. If you activate this switch, the UPNP server can access the saved smb password and the error does not occur anymore.
However, when I have initially added the smb share as a source for videos or for music, I haven't seen this switch. But you can force Kodi to display the dialogue if you remove the file with the saved passwords
After removing the saved password, Kodi will display the dialogue if you try to access your media from the smb share.