If you attempt to connect via a shared session as a guest, the user on the remote Mac needs to accept your request.
If the user hits Cancel, you will not be able to connect. Selecting Share Screen will grant you access so you can share a screen session.
Enable Shared Screen Sessions
Another cause for this error is that shared sessions are not enabled on the remote Mac. You can do so via System Preferences > Sharing > Remote Management > Computer Settings... > Anyone may request permission to control screen.
For more information about Remote Management, you can consult this article.