It turns out that to reproduce the issue, you need to unlist a topic, wait approximately 24 hours for the category stats job to run, and then delete the topic. That will cause the topic to have been removed twice from the category stats. After another 24 hours, the category stats job will have been run again. That should resolve the issue.
The reason this happens is that deleting a topic immediately removes the topic from the category stats. Unlisting a topic does not cause the topic to be removed from the stats until the daily job is run to update the category’s stats - that job checks for visible topics.