Clearing the cache didn't work because apparently I forgot to remove the calendar event when deleting a topic.
The fix:
scripts/doexpirethreads.inc.php
About line 238 you'll see:
$html->send_redirect(
Right before that, add this:
$query = "
delete from {$config['TABLE_PREFIX']}CALENDAR_EVENTS
where TOPIC_ID = ?
";
$dbh->do_placeholder_query($query,array($Number),__LINE__,__FILE__);