Hello @hwajeong lee,
welcome to this moderated Azure community forum.
I tried the command on a Azure Digital Twins environment myself and it works as expected:
You need to fill in the name of the ADT environment, resource group and email address of the person
Check if the email address is already registered within EntraID/AAD.
Please check the actual values of $dtname etc.
I did not need to use quotes for the values.
I expect you performed an 'az login' already, pointing to the right subscription.
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.