This may be another concurrency issue. In org.jivesoftware.openfire.muc.HistoryRequest/sendHistory() the messages are send maybe in the right or wrong order. Without logging this is hard to tell.
for (Object aHistoryToSend : historyToSend) {
joinRole.send((Message) aHistoryToSend);
}