Hello Khul,
Thank you for posting in the community.
This status is because of the registration of an agent has been made and there is no communication between the agent and the manager. See this for more information: https://documentation.wazuh.com/current/user-manual/agents/agent-life-cycle.html#agent-status
I see you say the agent goes from active to pending, this could mean there is an automatic registration in progress (you can see the agent ID changes). To check if this is the case please check if you have a script configured somewhere that is making the registration.
In Wazuh 4.3 by default when the agent can not connect to de manager, after some retries it tries for a new registration to the manager. Having said that, please check if you have any networking issues that can cause this behavior.
This threshold is managed by these configurations: https://documentation.wazuh.com/current/user-manual/reference/ossec-conf/global.html#agents-disconnection-time
<agents_disconnection_time>1m</agents_disconnection_time>
I hope this information could be helpful.