First, check your other devices and see if the mailboxes are set to the server mailboxes and not local. Especially the trash.
I don't think it's a gmail issue nor a connection problem either. It's a wrong setting or corrupt file that was migrated from your old computer.
Try this process below. You will need to recreate customized settings, but it should reset your Mail user preferences:
Remove Container file Mail:
Quit Mail.
In the Finder, select Go, then Go to Folder. Copy and paste the path below and hit GO:
~/Library/Containers/com.apple.mail
Move the whole com.apple.mail folder to the Trash, and open Mail and test. If all goes well, you can empty the trash. You may need to re create your user settings.
If the above doesn’t work, repeat the process with this folder:
~/Library/Containers/com.apple.MailServiceAgent
If there is a problem or you wish to restore the old file, first, Quit Mail.
Then open the Trash. Right click on the folder and choose Put Back from the menu.
If nothing works, it might just be best to delete the gmail account from internet accounts in system preferences. Restart the computer, then add the gmail account back in.