The Twist: The bumbling cross-eyed King is disposed of early on by his own vanity. His Portrait, which he had painted to correct his squint, comes to life, tosses the real King into the void, and takes over. This 'Portrait King' is the competent, terrifying villain of the film.
The Ending: The Bird pilots the Giant Robot to completely destroy the King's castle, reducing the vertical city to a pile of rubble. In the final scene, dawn breaks over the ruins. The Robot sits silently. A bird (one of the Mockingbird's chicks) is trapped in a small cage. The Robot gently lifts the cage, opens the door to free the bird, and then smashes the empty cage with its massive fist. This final image serves as a definitive rejection of captivity and a solemn vow to protect freedom.