If you have filesystem access, there is a procedure to regain admin access.
A way to regain access: The Emergency User
If you are locked out (not logged!), there is a way to regain access if you have access to the server. The procedure to create a so called Emergency User uses the adduser command and wrapped into a script addzopeuser.
- This is described in the docs: Zope manager users — Plone Documentation v6
It is sufficient for local development or bare metal installs.
See also my post: