Thank you for reaching out to the Microsoft Q&A platform. Happy to answer your question.
There seems to be issues in the system that preventing the update of the task state from propagating. However, in general situations like this if we observe the node state where the task ran, it will return to idle (assuming no other tasks are scheduled to it or are currently running).
If you would like to force delete it, you can use "Remove-AzureBatchJob" PowerShell command. The Remove-AzureBatchJob cmdlet deletes an Azure Batch job. This cmdlet prompts you for confirmation before it removes a job, unless you specify the Force parameter
Example: Remove-AzureBatchJob -Id "Job-000001" -BatchContext $Context
For details, you can refer to the following link https://learn.microsoft.com/en-us/powershell/module/azurerm.batch/remove-azurebatchjob?view=azurermps-6.13.0
Hope this helps!
--please don't forget to upvote and accept as answer if the reply is helpful--