If you go back to the tracker overview, you'll see that this ticket appears to have a higher number of comments than it actually does, beacuse I have edited the comment below.
After a quick browse, I suspect the problem is in here:
"""Returns comment counts indexed by ticket id."""
col = TicketComment.ticket_id
.filter(col.in_([t.id for t in tickets]))