Interesting article! It's really unfortunate that you got so close, you knew exactly what was wrong, but couldn't find where it happened! What's even more interesting is that you actually reached out to Stephen Fewer and he solved the issue! I've been writing software for a while, but I usually have this mindset that more well known and successful researchers are too busy to respond.
Maybe the next time I have a problem, and know of someone who is highly skilled in that area, I'll send them an e-mail.