If you find that you lose connection to your shares from a network location randomly, then go into Device Manager
(devmgmt.msc) on the PC that is the source of the shares. For each network adapter, uncheck the Allow the computer to turn off this device to save power
option in the Power Management
tab, and click/tap on OK
The network adapter may be getting put to sleep, and breaking the network connection of the shares.