I think it’s not the problem of thunderbird, but of any mail client which supports threading. But I don’t know whether the difference between different informations within in-reply-to and references here may depend on different interpretations.
What I actually see is that you fixed References by now, according to rfc5322:
In-Reply-To: quotes the message-id of the message you reply to.
References: appends the message id of the replied message to the former references
First post
Message-ID: <msg-id1>
…and no References
1st reply
`
Message-ID: <msg-id2>
In-Reply-To: <msg-id1>
References: <msg-id1>
`
2nd reply:
…
Message-ID: <msg-id3>
In-Reply-To: <msg-id2>
References: <msg-id1> <msg-id2>
…
However, you broke the message IDs as indicated within
BTW: Is there another bug that marking multiple lines as preformatted text
does include the cmd-e marking not once, but many times, for each line one?