Had the same problem
https://www.python-ldap.org/en/python-ldap-3.3.0/reference/ldap.html?highlight=cacert#tls-options
libldap does not materialize all TLS settings immediately. You must use OPT_X_TLS_NEWCTX
with value 0
to instruct libldap to apply pending TLS settings and create a new internal TLS context
This solved for me.