Hello @Sanket Soni ,
I understand that you are getting an authorization error when trying to peer 2 virtual networks in same directory.
Are both the Vnets in the same subscription or different subscriptions under the same AD tenant?
You mentioned that you tried with DefaultCredentials and it works fine and you were able to peer the Vnets but when you try with clientId and clientSecret, you are getting an error. And the error says that the client does not have authorization. So, I would request you to check the permissions for that clientid.
Kindly look for application/SPN name with client ID: 'c5be8621-24f3-4e1a-be9f-76ec8427c0ca'.
Navigate to the subscription > Choose the subscription > Add Role assignment > Select role "Network Contributor" for the 'Microsoft.Network/virtualNetworks/virtualNetworkPeerings/write' permissions > assign to the application SPN:
Kindly let us know if the above helps or you need further assistance on this issue.
Please don’t forget to "Accept the answer" wherever the information provided helps you, this can be beneficial to other community members.