Teams is a pile of <insert slang here>
Starting with El Cap or shortly after, macOS began to employ more granular control of various parts of the system and each application has to specifically request access to do certain things.
Apps like Zoom, WebEx, TeamViewer, Teams, etc., that want to share your screen contents could do so in the past without any specific permission request. That changed and when you try to use these apps without giving them the appropriate permissions, they can get the list of windows/desktops, but can't actually share the contents.
To alleviate that, you have to go to System Preferences->Security & Privacy. Scroll down to the option Screen Recording. You will see Zoom.us listed in this list but without a check mark next to it meaning it has requested but hasn't been given permission. So unlock the controls if locked by clicking on the padlock on the bottom left, click the checkbox next to Zoom. Re-lock and exist Sys Prefs.
Now restart Zoom just for good measure and you should be able to start a meeting with yourself and share your desktop/windows without issues.
If you aren't going to stick with Zoom, repeat this process for any other screen sharing app you end up with.