Have seen this before with SQL Server with really long topics. The posts are ordered by date in the SQL Query so can find nothing in the code that would cause such an issue, so can only put it down to a date bug with SQL Server.
The only thing that can be done is to close the topic and start with a new one. If a topic is getting that long that it has many 1,000's of posts in it, it is worth considering starting a new forum as this would place allot less strain on the database allowing your forum to run faster but with more topics and posts.