Cannot delete native users after LDAP integration?

Nextcloud version (eg, 20.0.5): 21.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu Server 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.46
PHP version (eg, 7.4): 7.4.18

The issue you are facing:

I have a nextcloud environment in my homelab and am transitioning from different logins for each service I host to LDAP. This is working well; I have LDAP built and working and integrated into Nextcloud. The users show up with uuid’s as their usernames. That being said, the display/logon names overlap between ldap and the native users. I was able to change the native users’ displaynames to distinguish them in the UI. I have migrated files and settings from the native user accounts to the ldap user accounts, and users are able to log in with ldap and see their files. I now want to delete the native user accounts, just leaving the ldap ones (I have read that you cannot merge native/ldap accounts). First, I disabled the accounts, that was successful. When I go to delete the accounts, I get a popup saying “An error occured during the request. Unable to proceed.”

Is this the first time you’ve seen this error? (Y/N): Yes, this is new

Steps to replicate it:

  1. Create native user
  2. Connect LDAP, which has a user with the same name
  3. Delete the native user
  4. Receive Error

The output of your Nextcloud log in Admin > Logging:

Error	no app in context	Doctrine\DBAL\ArrayParameters\Exception\MissingNamedParameter: Named parameter "user_id" does not have a bound value.
/var/www/nextcloud/3rdparty/doctrine/dbal/src/ExpandArrayParameters.php - line 64:
Doctrine\DBAL\ArrayParameters\Exception\MissingNamedParameter::new()
/var/www/nextcloud/3rdparty/doctrine/dbal/src/SQL/Parser.php - line 79:
Doctrine\DBAL\ExpandArrayParameters->acceptNamedParameter()
/var/www/nextcloud/3rdparty/doctrine/dbal/src/SQL/Parser.php - line 96:
Doctrine\DBAL\SQL\Parser::Doctrine\DBAL\SQL\{closure}("*** sensiti ... *")
/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1692:
Doctrine\DBAL\SQL\Parser->parse()
/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1128:
Doctrine\DBAL\Connection->expandArrayParameters()
/var/www/nextcloud/lib/private/DB/Connection.php - line 257:
Doctrine\DBAL\Connection->executeStatement()
/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 213:
OC\DB\Connection->executeStatement()
/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 287:
Doctrine\DBAL\Query\QueryBuilder->execute()
/var/www/nextcloud/apps/epubreader/lib/Hooks.php - line 60:
OC\DB\QueryBuilder\QueryBuilder->execute()
/var/www/nextcloud/apps/epubreader/lib/Hooks.php - line 32:
OCA\Epubreader\Hooks::deleteUser()
<<closure>>
OCA\Epubreader\Hooks::OCA\Epubreader\{closure}("*** sensiti ... *")
/var/www/nextcloud/lib/private/Hooks/EmitterTrait.php - line 107:
call_user_func_array()
/var/www/nextcloud/lib/private/Hooks/PublicEmitter.php - line 41:
OC\Hooks\BasicEmitter->emit()
/var/www/nextcloud/lib/private/User/User.php - line 221:
OC\Hooks\PublicEmitter->emit()
/var/www/nextcloud/apps/provisioning_api/lib/Controller/UsersController.php - line 783:
OC\User\User->delete()
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 218:
OCA\Provisioning_API\Controller\UsersController->deleteUser()
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 127:
OC\AppFramework\Http\Dispatcher->executeController()
/var/www/nextcloud/lib/private/AppFramework/App.php - line 157:
OC\AppFramework\Http\Dispatcher->dispatch()
/var/www/nextcloud/lib/private/Route/Router.php - line 302:
OC\AppFramework\App::main()
/var/www/nextcloud/ocs/v1.php - line 63:
OC\Route\Router->match()
/var/www/nextcloud/ocs/v2.php - line 24:
require_once("/var/www/nextcloud/ocs/v1.php")

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '---',
  'passwordsalt' => '---',
  'secret' => '---',
  'trusted_domains' => 
  array (
    0 => 'hda.DOMAIN.com',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '21.0.1.1',
  'overwrite.cli.url' => 'https://hda.DOMAIN.com/nextcloud',
  'dbname' => 'hda_nextcloud',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'usr_nextcloud',
  'dbpassword' => 'PASS',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'hda.DOMAIN.com',
  'mail_smtphost' => '127.0.0.1',
  'mail_smtpport' => '25',
  'app_install_overwrite' => 
  array (
    0 => 'breezedark',
    1 => 'epubreader',
    2 => 'printer',
  ),
  'default_phone_region' => 'US',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
);

The output of your Apache/nginx/system log in /var/log/____:

Nothing relevant