Hi Andy,
Thanks for reaching out to Microsoft Q&A.
I have analyzed your Payload and tried to run the Az command you mentioned and got the same error.
az resource create --resource-type Microsoft.EventGrid/namespaces --id /subscriptions/X/resourceGroups/X/providers/Microsoft.EventGrid/namespaces/X --is-full-object --properties NS.json
Error parsing JSON.
NS.json
Expecting value: line 1 column 1 (char 0)
To resolve this error, you need to enclose the parameters in double quotes and add @ before the file name NS.json as below:
az resource create --resource-type "Microsoft.EventGrid/namespaces" --id "/subscriptions/SubscriptionID/resourceGroups/RGName/providers/Microsoft.EventGrid/namespaces/NamespaceName" --is-full-object --properties @"NS.json"
- You can also use below commands to create the custom domain. The parameters available to create domain using AZ CLI are mentioned in MSDOC1 and MSDOC2:
 
az eventgrid domain create --name
                           --resource-group
                           [--identity {noidentity, systemassigned}]
                           [--inbound-ip-rules]
                           [--input-mapping-default-values]
                           [--input-mapping-fields]
                           [--input-schema {cloudeventschemav1_0, customeventschema, eventgridschema}]
                           [--location]
                           [--mi-system-assigned]
                           [--mi-user-assigned]
                           [--public-network-access {disabled, enabled}]
                           [--sku {basic, premium}]
                           [--tags]
az eventgrid domain topic create --domain-name
                                 --name
                                 --resource-group
Follow below steps to avoids the stale identity metadata issues:
- Create a new Event Grid namespace in the same region but don't attach a user-assigned identity.
 - Enable system-assigned identity only from the start.
 - Configure Key Vault and custom domain immediately after creation.
 
Hope it helps!
Please do not forget to click "Accept the answer” and  Yes, this can be beneficial to other community members.
If you have any other questions, let me know in the "comments" and I would be happy to help you.