Problem Description:
Workflow cannot be terminated in the GUI
Resolution:
Stop the workflow on PowerShell
$web = Get-SPWeb “WebUrl”
$web.AllowUnsafeUpdates = $true;
$list = $web.Lists[“Listname”];
$wfm=New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
$workflowInstanceService=$wfm.GetWorkflowInstanceService()
$workflowInstance=$workflowInstanceService.EnumerateInstancesForListItem($list.ID,ItemID)
$workflowInstance
$mywfi = $workflowInstanceService.EnumerateInstancesForListItem($list.ID,ItemID) | where ID -eq WFIID
$workflowInstanceService.TerminateWorkflow($mywfi)
$web.Dispose()