Thanks for reaching out to Apple Support Communities, manmathan176.
We would be happy to help assist with the difficulties you're having connecting your Mac to Wi-Fi. Can you tell us if you are on the most updated version of Big Sur? We'll want to be sure that your Mac is completely up to date with the latest software version. The following article can help walk you through the steps for that if needed.
How to update the software on your Mac
We can also have you try booting your Mac into safe mode and see if you notice the same behavior there as well. Safe mode prevents your Mac from loading certain software while starting up so this will help tell us if something on your Mac is interfering with your ability to connect to Wi-Fi. The article below will walk you through the process of how to boot your Mac into safe mode. Once your Mac is in safe mode, go ahead and try to disconnect from your Wi-Fi source and see if you receive the same error when trying to reconnect,
How to use safe mode on your Mac
Let us know if this helps.