Macbook Pro mid-2012 restarts after entering password
Without the firmware password you will need to take your machine to an Apple Store or official Service Provider, along with proof of ownership.

Ref: Apple KB: How to set a firmware password on your Mac

The old 'remove the RAM' or 'reset NVRAM' tricks etc only work with older PowerPC Macs, not Intel.