Apple has made many security improvements in macOS during the past few years. This means that sometimes when you connect to a remote Mac, the login window appears even though you've already log in via Screens:
Apple added this feature for improved security when remotely controlling a computer in an environment where you don't want the computer to remain unlocked when you are done screen sharing.
Fortunately, there are some workarounds:
1. Disable the functionality
If you want to disable this functionality, you can open Terminal on your remote Mac and type:
sudo defaults write /Library/Preferences/com.apple.RemoteManagement.plist RestoreMachineState -bool no
Use yes instead of no to restore the functionality.
We do not recommend to turn this functionality off unless you are certain that no one else will be able to access your Mac physically when you are away.
2. Set your Mac to automatically log in during startup
You can turn on automatic login for a macOS user account, so your Mac automatically logs in to that account during startup.
See this Apple article for more details: https://support.apple.com/en-ca/HT201476
3. Hold to Send Password
We understand how frustrating this can become, especially when you have a long and complex Mac user password. This is why we developed a feature called "Hold to Send Password", which is available on iOS and Mac (on which the feature is called One-Click User Password". You'll find more information about this feature here.