The error list of the Flask Python app is not collected in ES APM

Env
OS: Ubuntu Linux (Container to be exact)
Python version: 3.10
Framework and version [e.g. Django 2.1]: flask-3.0.2
APM Server version: 8.15
Agent version: 6.23.0

Using all default values.

Agent Setup (code)
def configure_apm(wsgi_app: Flask) -> None:
apm = ElasticAPM(wsgi_app, enabled='TRUE', debug='TRUE')

Agent option
ELASTIC_APM_SERVICE_NAME : app
ELASTIC_APM_SERVER_URL : http://
ELASTIC_APM_CAPTURE_HEADERS : "false"

In a Java application, error lists are displayed properly, but errors are not identified in Python applications only. What should I look for?