Account Linking Error through Actions Flows


I am fairly new to the auth0 and I am trying to implement an Account Linking script through Actions Flows for my Next.js app. Overall, the script is working, however, when the account linking script is being triggered (for example user has an auth0 connection and tries to login with google) - the script works and connects accounts, but at the same time it ‘erases’ google account and user get an error callback. The server throws this error:

 error_description: 'Main identity and the new one are the same.',
  providerId: 'auth0',
  message: 'access_denied'

I assume the issue lies within the way the user info being passed, since the google account does not exist anymore, it throws error.

Next login flows are working as intended, however, the initial linking ruining whole process. Could you please help? Thanks in advance.