If the local password database is corrupted, you may need to restore from your most recent configuration backup (typically stored on your PC or downloaded previously).
As a final option, you can reinstall OPNsense on the device and then import your previous configuration; your networking and VPN settings will be restored, but you will recover admin access cleanly.
As a final option, you can reinstall OPNsense on the device and then import your previous configuration; your networking and VPN settings will be restored, but you will recover admin access cleanly.