I found the solution - you need to disable ldap plugin in admin panel -> manage -> plugins. Even if you don't set any ldap connection osTicket in this search window looking for ldap and log error in apache.
[Mon Oct 18 15:20:28.666103 2021] [php7:warn] [pid 303426] [client 195.205.251.100:62952] PHP Warning: Invalid argument supplied for foreach() in phar:///var/www/osticket/include/plugins/auth-ldap.phar/authentication.php on line 152, referer: https://xxx.com/scp/tickets.php?id=226
[Mon Oct 18 15:20:28.666476 2021] [php7:error] [pid 303426] [client 195.205.251.100:62952] PHP Fatal error: Uncaught Error: Call to a member function bind() on null in phar:///var/www/osticket/include/plugins/auth-ldap.phar/authentication.php:176\nStack trace:\n#0 phar:///var/www/osticket/include/plugins/auth-ldap.phar/authentication.php(302): LDAPAuthentication->_bind()\n#1 phar:///var/www/osticket/include/plugins/auth-ldap.phar/authentication.php(449): LDAPAuthentication->search()\n#2 /var/www/osticket/include/class.auth.php(336): StaffLDAPAuthentication->search()\n#3 /var/www/osticket/include/ajax.users.php(47): AuthenticationBackend::searchUsers()\n#4 /var/www/osticket/include/class.dispatcher.php(145): UsersAjaxAPI->search()\n#5 /var/www/osticket/include/class.dispatcher.php(38): UrlMatcher->dispatch()\n#6 /var/www/osticket/include/class.dispatcher.php(120): Dispatcher->resolve()\n#7 /var/www/osticket/include/class.dispatcher.php(38): UrlMatcher->dispatch()\n#8 /var/www/osticket/scp/ajax.php(316): Dispatcher->resolve()\n#9 {main}\n thrown in phar:///var/www/osticket/include/plugins/auth-ldap.phar/authentication.php on line 176, referer: https://xxx.com/scp/tickets.php?id=226