If you are sharing your screen and Mac using Remote Desktop, you need to turn on remote management in Sharing preferences.

Open Sharing preferences if it isn’t already open, then select the Remote Management checkbox.

Do one of the following:

Select “All users” to let all users on your network connect to your Mac using Apple Remote Desktop.

Click Options, then select the tasks remote users are permitted to perform (Tick ALL the boxes)

Click Computer Settings, then select options for your Mac.