IMAP emails are all addressed by a 32bit UID. Overwriting it would require that you experienced a hash collision, data race, or that your IMAP provider sent out the wrong set of IDs.
It's incredibly unlikely to be Thunderbird's fault.
It's incredibly unlikely to be Thunderbird's fault.
It wasn't an overwritten message or IMAP bug, it was some corruption of the Thunderbird folder index.
The corruption bug likely lay with Thunderbird and not the IMAP server.