Nextcloud LDAP Failover to Local Auth

LDAP authentication disables local authentication completely when LDAP server is not reachable even the admin user cannot login to Nextcloud portal throwing an internal server error blue screen.
Now it is not possible to switch back to local auth unless LDAP is removed from GUI.
How can we remove LDAP from backend?

You have to be able to get to Nextcloud installation on the server.

There is an occ file that you can use to execute commands against your nextcloud instance. To disable LDAP you can run this command

./occ config:app:set user_ldap enabled --value 0

If you need to, you can also reconfigure the LDAP settings there, so that you can re-connect to your LDAP server.