Well, why not tell “you aren’t allowed to delete the topic”, instead of showing an error?
I know that the delete button is visible even if the topic has a reply, so you aren’t allowed to delete the topic. The text on hover also reflects that. Example from the last topic I created at Meta:
