Planets also need a Biosphere, so that density is not reachable without having 5% of the population constantly working in terraforming facilities to recycle Air, and they neer to produce food or industrial goods.
Then you would require a high amount of materials aswell, so Earth would pretty much be capped between 20 and 50 billions, depending on technology.
Also, A certain pop should automatically produce a limited amount of destructible, but unremoveable Infrastructure and production capacity every million or so.
at 1 billion, earth would then have, say, 1000 Infrastructure, I mean, in case of a nuclear Bombardment, someone always survives in a tunnel or something, this would mimic that.
Also, I always found it weird how a populace without industrial capacity can't build any, like, if you find a preindustrial civilization, grant them TN tech, and wait 100 years, the will still be a preindustrial civilization, as their capacity to produce equals zero and can't really be raised at all.