Make sure that the HTTP headers x-dtPostBody, x-dtHealthCheck and x-dtAgentId do not get blocked in your environment. The UEM Health Check needs them to work properly.
Please check the below link for the 404 error.
The Agent is not delivered.
The Agent URL is not reachable. The following reasons may explain why:
What is your agent and dynatracemonitor path in the User Experience settings?
Is this default or you changed?
What is your application architecture e.g. Web (web server Apache, IIS etc..) > App (.Net, Java etc... > ?
The Agent path is not handled by a web server with an installed Agent.
Can you ask from developers or owner of the application about the sub-path (e.g. /app/)?
Last consideration should be to check whether the Agent path is blocked by a firewall.