Issue in Fleet managed APM server configuration

I am trying to install Fleet managed APM server on 8.14.2, but getting below error

fleet
│ └─ status: (STOPPED) Not enrolled into Fleet
└─ elastic-agent
├─ status: (DEGRADED) 1 or more components/units in a failed state
└─ fleet-server-default
├─ status: (HEALTHY) Healthy: communicating with pid '17578'
├─ fleet-server-default
│ └─ status: (FAILED) Error - failed version compatibility check with elasticsearch: elastic fail 401: security_exception: missing authentication credentials for REST request [/]
└─ fleet-server-default-fleet-server-fleet_server-ae583-4ee-acd-f46883
└─ status: (FAILED) Error - failed version compatibility check with elasticsearch: elastic fail 401: security_exception: missing authentication credentials for REST request [/]

Fleet Server Policy(elastic-agent.yml):
id: fleet-server-policy
revision: 23
outputs:
default:
type: elasticsearch
hosts:
- 'http://x.x.x.x.:1111'
username: xxxx
password: xxxx
preset: balanced
fleet:
hosts:
- 'https://x.x.x.x.:8220'

Please let me know if I am missing anything?

From Elasticsearch to APM

I've moved this to the APM topic.

Added server