Protip: Throwing everything you have at a planet and leaving nothing else is a very, very bad idea, especially when it's a homeworld. Frankly, an AI homeworld is bound to be very, very heavily defended and will massacre your fleet several times even if it's the strongest you can make it. The AI homeworlds also have a set of very nasty guard posts that can do grevious damage to both your fleet and even your worlds that are far, far away.
Don't expect to take everything in a sweeping blow, ever. Always have contingency plans. Don't throw in everything you have and have nothing left to defend.
What I would do would be to send in a small fleet primarily consisting of bombers and other ships that hit structures hard, and focus fire guard posts one by one. After the attack wave inevitably gets destroyed, rebuild it while lounging under your defense fleet which more than likely is able to fend off attacks for the amount of time it take for the bombers to rebuild. Wash, rinse, and repeat until the homeworld suddenly happens to lack any core guard posts left. At that point, you can go and destroy it rather easily, as most of the hard-hitting defenses on that world are now gone.
You should always set up lots of static defenses(turrets, fortresses) and make sure you have some rolling defenses (mobile ships) to cover up weak points. Set up chokepoints and force most of the AI to go through one or two planets so you can concentrate your defenses more and take advantage of splash damage from lightning turrets and electric shuttles.
Simply put: You're doing it wrong. Don't go all-in, especially when you've still got another AI homeworld to deal with. Make sure you have something to defend with if and when your assault fails. Attack in small waves to whittle away at the homeworld until it's easy to take in a single blow.