This seems to be by design, I can reproduce your problem locally, even if the owner of the file deletes the file in OneDrive, we are still able to get it via the graph api. I'm not sure if this is intentional, but it's definitely not a good user experience because it creates confusion.
I recommend that you submit a user voice to the MS graph product team to standardize the graph api's response, files that have been deleted should definitely not be present in the
/sharedWithMe API call.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.