Hi,
What version of Wazuh are you using?
As you say, it seems that it cannot connect because some wazuh-manager daemon is down or disconnected. From your message, it seems to be wazuh-modulesd.
By chance, do you have a Wazuh version lower than 4.3.2, vulnerability detector enabled and some Windows agent?
In version 4.3.1 it was detected a crash in vulnerability detector module when scanning agents running on Windows. See the changelog from 4.3.2
This was fixed in version 4.3.2 but I recommend that you upgrade to the latest version (4.3.3).
In case you have this problem in the current version, can you share the /var/ossec/logs/ossec.log file of the wazuh-manager? Also run the command /var/ossec/bin/wazuh-control status in the wazuh-manager when you have this problem, to see which daemons are active and which are not.
I look forward to your reply.
Best regards.