Error Delete Company Transactions


I encountered error when deleting company transactions. The error is ValidationError: Record does not exist which is thrown from frappe/model/ I’ve tried running the query on that python file which is

select modified, docstatus from `tabCompany`
where name = <my company> for update

But it return empty array. This is query explain result:

  "rows": null, 
  "select_type": "SIMPLE", 
  "Extra": "Impossible WHERE noticed after reading const tables", 
  "ref": null, 
  "key_len": null, 
  "possible_keys": null, 
  "key": null, 
  "table": null, 
  "type": null, 
  "id": 1

Thank you.