The calc for the upgrade path is off big time. Your problem starts when you hold off counting production for the upgrade stage - you're also not counting every other facility already built, it appears. Just plug some hard numbers in and take a look...