Hi vanshsharma8, I am Paulo and I'd like to help.
This error could be a sync error or mostly if Google's Settings less secure apps option isn't turned on. You can go here then enable it in your Google account
https://myaccount.google.com/lesssecureapps
If that didn't fix it, you can remove the account from the Mail app and then re-add it manually using IMAP.
First, you have to enable IMAP in Gmail.
- On your computer, open Gmail https://mail.google.com/
- In the top right, click Settings Settings and then See all settings.
- Click the Forwarding and POP/IMAP tab.
- In the "IMAP access" section, select Enable IMAP.
- Click Save Changes.
Next, open the Mail app.
- Go to Settings (Gear icon) > Manage Accounts > Add Account > Advanced Setup and then to Internet Email.
- Fill in the details like this:
Account Name: Any name related to your Gmail
Your Name: Your name
Incoming Mail Server: imap.gmail.com:993
Account Type: IMAP4
User name: your Gmail address
Password: the one-time password you just generated, otherwise just your Gmail password
Outgoing SMTP email server: smtp.gmail.com:465
All checkboxes are checked.
Now sign in and check if the issue is fixed.