Agent configuration infrastructure is not ready

It probably means your APM server can not connect to elasticsearch... probably because your elasticsearch has a self-signed cert and thus the APM server fails to connect.

See SSL/TLS output settings | APM User Guide [8.11] | Elastic

You can share your compose