There are settings with gmail, yahoo, & other clients with preference.
If setting up Apple mail app with gmail; and it won't work, you'd have
to try the settings again. To be sure gmail itself is OK, that can be set
to work from a browser. Gmail can be used to authenticate Apple mail.
• Add an email account to Mail on your Mac - Apple Support
https://support.apple.com/en-us/HT204093
• Set up a Gmail Account Using the Apple Mail Application | lifewire
https://www.lifewire.com/set-up-gmail-account-with-macs-mail-application-2260069
Apple Mail supports the methods of communicating with the Gmail servers.
You can add a Gmail account the same way you'd add any POP or IMAP
account you currently use. For most part, articles cover general knowledge.
Search results - Gmail Help (change to suit)
https://support.google.com/mail/search?q=set+up+gmail+with+Apple&from_promoted_search=true
https://duckduckgo.com/?q=how+to+set+up+Gmail+for+Apple+Mail+in+MacBook+Pro+2020&t=ffab&ia=web
• Choose your IMAP email client settings for Gmail - Gmail Help
https://support.google.com/mail/answer/78892?hl=en
When there's a hand-off with cell phone and computer, those settings could
be partial reason your Mac and phone may not be set up correctly to do this.
Check the Continuity between your products to be sure settings are correct.
• Use Continuity to connect your Mac, iPhone, iPad, iPod touch, and Apple Watch - Apple Support
https://support.apple.com/en-us/HT204681
• System requirements for Continuity on Mac, iPhone, iPad, iPod touch, and Apple Watch - Apple Support
https://support.apple.com/en-us/HT204689
All this, and maybe could be the devices all need to just be restarted, to connect correctly?
If no other solutions work, try setting up your email account again.
To do that, remove your email account, then add the account back