FYI TunaFish... I am not sure of cause and effect, but you were the topic of discussion on Discord last night...
Well sort of.
I had wondered about including the whole 'Inputs to factories can sneak up on you' comment, but felt obligated to do so since I expect that was the primary unaccounted for source of debt.
Anyway... I say you popped up in the discord discussion, because that specific aspect of debt, is actually an advanced strategy, that most beginners (myself included) exploit unwittingly. Of course, since they are exploiting the strategy unwittingly, the strategy usually leads to disaster., but it is the strategy simply stated as: Converting Debt to Cash.
Example: I have 100 water worth 100 gold that I will use to produce 100 oxygen at 200 gold.
Standard Math 1: I sell the water and turn of oxygen. Net 10000 cash
Standard Math 2: I wait for the water to convert to oxygen. Net 20000 cash
Convert Debt to Cash: I sell the water and buy the water for oxygen on the open market then sell the oxygen. Net 30000 cash, 10000 debt (I have thus converted 10K debt into 10K cash because I bought the water used to make oxygen via cash)
They were going into more details and ramifications but last night, you were the muse of discord.