I think I might have found what was responsible for the double posting issue: if the bot doesn't receive a response from the Lemmy server in time, it might not record the post as having been submitted. As a backup, the bot also checks the list of submitted posts on Lemmy for duplicate titles, but if Lemmy is lagging, then that wouldn't work either.
I've added another check that should address that issue. I'll also have the bot check if it made any duplicate posts and delete them.