As the title, is there a way to restore a Mac when you forgot the recovery password, I tried with command + R during reboot, but it doesn’t help.
Apple documents firmware passwords and how you want to schedule an in person appointment if you lose the password:
If you forgot your firmware password
If you can't remember your firmware password or passcode, schedule an in-person service appointment with an Apple Store or Apple Authorized Service Provider. Bring your Mac to the appointment, and bring your original receipt or invoice as proof of purchase.