How to handle issues deleted from jira in fetch issue details rest api call using post method?

URL: https://domainname.atlassian.net/rest/api/3/search?_r=1705582635144
Method: POST
Payload: 1. {jql: “id in ( 10002 )”, startAt: 0, maxResults: 1, fields: , fieldsByKeys: false, expand: }

Hint: The issue with id 10002 has been deleted from jira manually.
Result: when we do this fetch call, it is returning 400 bad request.
Expected: a way to handle this. I am not expecting 400 bad request.