When iCloud Drive is not uploading see the article Access iCloud Drive files from your iPhone and other devices - Apple Support
You must have followed this article signing out Apple ID from Mac system preferences and again signing in with same account credentials was not a solution .
But , you have signed out and again signed in the upcoming steps if the Apple ID address say is example1@gmail.com and the account is set up with secondary authentication account in which three answers for respective questions , date of birth , rescue mail address and its password were added and iCloud Keychain is set up Set up iCloud Keychain - Apple Support
The iCloud Keychain security would be required iCloud security code - Apple Community
It's not necessary if you add mail account Add an email account to Mail on your Mac - Apple Support ( by the way adding of mail account doesn't appear in upcoming steps ) your gmail account that is an Apple ID will be successfully established , only the box of iCloud Drive ( also desktops and documents box has to be checked ) appears in last step , and mail box is to be checked .
Note : if your Apple ID is set with 2FA the upcoming steps will be totally different in Mac OS Catalina 10.15.7 ( as your profile shows ) .