The only people interested in making it work are interested in making it work for the community they are Migrating. Yours is different. The existing script is broken for your community but has worked for others. Every import is a snowflake.
The likelihood that it’ll ever just work for you is pretty slim. It will almost certainly require several hours work from someone who’s familiar with import scripts or a good deal more than that for a decent programmer whose unfamiliar with discourse or ruby (I wrote several importers before I knew ruby).
Oh. That’s more than I would have guessed.
I think I may have written similar code to deal with attachments that are sometimes embedded in the post and sometimes not myself, but I wasn’t generous enough to make a PR.