What's missing in this post is a deep analysis of what the bugs are and what was causing them, in a 5 times why sense. Especially if they all seem dumb stuff at first.
There are some deep lessons about programming in this Factorio Friday Facts:
I'm pretty sure the answer is usually "concurrency". The examples alluded to in TFA sound like it. Handling concurrency is notably extremely hard, and an RDBMS is what other applications use to solve their hairy concurrency problems so they don't have to.
There are some deep lessons about programming in this Factorio Friday Facts:
https://factorio.com/blog/post/fff-366
and I wonder if postgres doesn't look like fig.1 from this blog post, before the refactoring.