Good guess, I can see why you'd think that, but wildly incorrect. Here's how it works in a nutshell:
Income:
All the various income you get is added to your stores once per second.
Expenses:
All the various expenses you have are subtracted from your stores in tiny increments 20 times per second.
Implications:
You are correct that if you don't have enough to fund all the things your are building, that not all of them will build. BUT, based on the above, you have to have really super incredibly negative income for that to happen -- the more likely case is that everything builds, just at various super slow rates.
On at least the first few of those 20x cycles per second, for instance, you'd have some resources going to everything unless you were spending 20x more than your income, see what I mean? And if you're spending that much more than your income is, the game assumes that this is such an invalid situation that you'll be disabling some expenses any moment now, eh?
One important note, though: if your expense-per-cycle (1/20th of the shown expense per second) is not able to be met even on the first cycle per second, then you'll see zero process even if you're not thousands into the negative.
What I think was happening in your case was this: it was building, just very slowly. For a ship with relatively low health (even a few hundred thousand) but an astronomical cost, if you're building very slowly you'll see a very slow buildup, especially if it's not able to spend all the resources per second on actually building it. You should be able to verify that it is building by hovering over it with the mouse and looking at the BP (Build Points) counting upwards. If those are really low and slow, then it might be that it's only spending on a couple of cycles per second, rather than all 20. If those are going up not at all, then you're really bottomed out.
Either way, sounds like it is working fine -- or at least, I'm not aware of any outstanding issues with this at the moment, let's put it that way, and this has been rather vigorously gone through by players in the past. We used to do expenses 1x per second as well, but through a lot of trial and discussion we made the expenditures more precise specifically to avoid the sort of situation you were hypothesizing about. But, with extremely-high-costing structures in an extremely low-yield economy, you might still see that to some degree, unavoidably. It's not wasting any of your resources if it can't actually gather build points, though, don't worry.
PS -- Incidentally, that 666 was mathematically incidental, we don't set the resource outflow rates in a direct fashion -- we set costs and time to build, and resource rates come about from that. So, purely a coincidence there.