You may receive an error when trying to open a Samba shared folder in Windows 10 or 11 if the Samba server is announced to the network using the WSDD service. Oddly, this error may not be constant; it may appear and disappear.
The reason for this is that WSDD announces not only the IPv4 address but also IPv6. Windows tries to connect via IPv6, and if your local network does not support this standard, it fails. The simplest way to fix this problem is to disable IPv6 support in wsdd. To do this, open the file /etc/default/wsdd and add the --ipv4only option to the WSDD_PARAMS variable:
/etc/default/wsddWSDD_PARAMS="--ipv4only"
After this, restart WSDD and everything should work:
sudo systemctl restart wsdd
If you want to read more about mounting samba shares in Windows or Linux - read this article.