iMac SSD upgrade – Firmware password lock
This Apple document tells you everything you need to know about Firmware passwords.

The essential points for you are:


Your Mac asks for the firmware password only when attempting to start up from a storage device other than the one selected in Startup Disk preferences, or when starting up from macOS Recovery.
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.


The Firmware password is not required for OS installation.

You will need to ask the original purchaser for their receipt or other proof of purchase.