Some Mail Messages show up as 2 message - but only to Applescript

I’ve had this problem for a long time and I’ve just been ignoring it but maybe nows a good time to try to work it out.

I have a script that works with the current selected email. Go to a mailbox, click on one email, activate script.

Usually this works fine, but maybe 10% of the time, the email will show up to applescript as 2 separate emails. In Mail.app, it only ever shows up as one message. And its not showing as two because its a multipart message. In fact nearly identical emails can show up both ways.

Has anyone ever dealt with this before, or know what might be going on?

I’m attaching two images. Each image contains the full raw source of an email, and then the applescript result when just that one email is selected and you ‘log selection’

NOTE: These emails are junk mail and the attachment is almost certainly a virus, so do not try to reconstruct the file.