Have you tried uninstalling and reinstalling the WD Discovery app from your Mac?
Trying the WD Discovery App on different Mac can also be helpful to isolate the issue whether the issue is limited with the software of with the Mac. However, WD My Cloud Desktop is no more given by WD. You can use files.mycloud.com instead of My Cloud Desktop App to remotely access the My Cloud device.
However, for the WD Discovery, it is best to collect the app logs and send it to WD Support so they can look for the issue in order to provide resolution for intermittent connection of the software.
It will be best to contact WD Support to find the resolution for such issue, as they may ask for the logs in order to find the root cause of the issue. You can refer the link mentioned below to collect the logs of WD Discovery.
You can contact WD Support from the link given below.