Have a try to update the NIC and NSG using the following commands and try delete again.
az network nsg update
az network nic update
Following links are the detailed references to find the usage of these commands
https://video2.skills-academy.com/en-us/cli/azure/network/nic?view=azure-cli-latest
https://video2.skills-academy.com/en-us/cli/azure/network/nsg?view=azure-cli-latest#az_network_nsg_update
----------
If the Answer is helpful, please click "Accept Answer" and upvote it