The various issues raised in the OP have already been covered in several separate threads.
1. Mechanics heal rate - when your attacking wave hits draft proof numbers, your heal rate drops to 0 and you only get healed to the equivalent of what your heal buffs are.
2. Trojans have been subject to discussion on how to stop this from happening (hence the 24hour alliance move cooldown).
You don't also state what defences there were in the city and from the screen shots, simply putting masses of mechanics in a city is not guaranteed to wipe out everything that city has. What layers did you use, what layers did the defender have, what techs / stars are in play and what wall defences were there?
IMHO you've been very naive in thinking your masses of pults and ballis will take out the city in full. I see from the reports, 2.9mil archers, 1.2mil swords plus Ballis, Pults, Rams and importantly - 29 fracts. Given the additional range bonus from the wall defences and the fract keeping your incoming units outside your own attacking range - i'd suggest you've not fully thought the hit through.