In case Sandbox is refreshed from Production Organization, please correct following configuration:
Fix Connected App Configuration
Connected Application, Authorization Provider and Named Credentials settings will hold information from Production Organization after Sandbox refresh. Please correct following attributes based on the Sandbox information:
Go to Setup > into the Quick find box enter:
Connected Application:
Callback URL field
Hit Save and Continue button
Authorization Provider:
Consumer Key field
Consumer Secret field
Hit Save
Named Credentials:
Disable Start Authentication Flow on Save
URL field
Hit Save
Enable Start Authentication Flow on Save (if needed)
Hit Save to start auth. process