Whether this error occurs when you run connect-PnPOnline?
You could try to clear browser cache then register PnP.Powershell again.
Since this question is more related to azure active directory, for better user experience, I have added "azure-active-directory" and "azure-ad-app-consent" tags.
Here are similar questions for you:
https://learn.microsoft.com/en-us/answers/questions/218696/pnp-error-when-connect-pnponline.html
https://github.com/pnp/sp-starter-kit/issues/436
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.