and 2 resource districts (gen+mine or 2x gen) so they support their own upkeep (to reduce the drain on Trade)
I don't think this is worth it. Trade costs are only 25% of value of the planetary deficit, and a big chunk of that deficit by value is going to be alloy for the replicators, which it sounds like you aren't producing locally.
My thinking has been to demolish one of the two starting Nexus district to reduce energy upkeep by 2/month (and a tiny bit of empire size from districts to boot). One city district, a Drone Storage, and an Assembly Plant is like 6 energy/mo upkeep (1.5 trade/mo), 300 replicators is between 3 and 4.5 energy/mo upkeep depending on habitability (call it 1 trade/mo) and 3 alloys/mo (3 trade/mo). Producing energy locally can only save you about 2.5 trade/mo, and incurs additional energy upkeep for the districts, buildings, pops, etc. So I've just been turning on 100 Logistics Drone jobs from the capital building and Machine Nexus designation for the +% trade and reduced building and district upkeep and calling it close enough; it doesn't quite cover the trade costs of feeding each of these worlds but it's close.
(And then throw in a Simulation Site per planet for no additional upkeep but a little bit of flat unity income, ignoring the stuff they give the maintenance drones who hang around temporarily after being assembled before auto-migrating somewhere with jobs)
On the other hand, Logistics Drones do have a pretty lousy base output per pop (4 trade iirc). Tech-drones with the machine species base output boost are so productive that maybe it does make sense to prefer them over Logistics Drones when possible (the "nice" thing about Logistics Drones is that as far as I can tell they have basically no support besides Machine Nexus and Logistics traditions, so you don't benefit a whole lot from centralizing them on a single specialized trade world vs distributing them on many tiny machine nexuses). I'd think you could cover each planet's energy upkeep with just one generator district and 100-200 tech-drones though. 600 pops per planet for local raw resource production seems like way overkill (unless you're also going to do the alloys for the replicators locally...?).
By and large I would say that my approach to shortfalls is simple - reallocate resources to stuff that produces the thing I don't have enough of. Not enough trade? Build Resource Reprocessor starbases (better than solar panels now) and work more trade jobs. Not enough unity? Work more unity jobs. Not enough pops? More replicators and automation buildings.