In addition to that, I have found another bug.
When you insert a new message, it tries to calculate its position by using bbp_get_topic_reply_count
The problem is that wordpress passes it through bbp_number_format filter and tries to convert it back to the integer.
In my case if a topic has 3000 replies, number format will be 3,000 and returned integer will become 3.