You may have to reinstall macOS. Your original issue sounds similar to what I have run into when a MacBook goes through setup assistant after sitting for a while. The certification can expire.
And I believe once you get that part in setup assistant, there is no way to get around it, even with restarting, except for reinstalling macOS. Had to do this on about 50 MacBooks, because I erase-installed Big Sur on them at the beginning of the summer. Come two months later and I got that error on almost all of them.
Oh, I am unable to do the reset coz ion recovery when I select the disk or Options it takes me back to setup page instead of giving me option to reset. Did I miss anything or doing something wrong ?
If you're having trouble reinstalling macOS on the laptop itself, I would suggest going the route of using AC2 (Apple Configurator 2). You'll need another MacBook (preferably another M1) and connect the two laptops by a cable, like the one used for the charger.
On the other MacBook, you'll open AC2 to monitor the status of the MacBook you're reinstalling macOS on. After connecting them, you will want to put the M1 Pro into DFU mode. You will notice AC2 showing DFU in large letters when this is done correctly. Now right click on DFU and choose Restore.
By default it will reinstall the newest available version of macOS, if you don't want this, you will need an IPSW file of the desired version. You will see a progress bar showing the status of the M1 Pro until eventually it will be at the Setup Assistant again.
Hopefully this is easy enough to follow. Here is a more detailed guide from Apple.