I don't see a bug there, ordnance factories and gate construction modules are 25,000 tons, in the first instance 2 gate modules takes 50,000, the remaining 10k is .4 ordnance factories, in the second instance remembering research labs are 500,000 tons your one ordnance factory requires 25k, tge remaining 35k being exactly .07 research labs.