Well I had a neat thought. What if Bruce Wayne is still in the pit and the ending was a hallucination? It would explain all the logical inconsistency and plot holes. It would also explain why Bruce Wayne basically got everything he wanted. A reborn city, his reputation restored, retirement as Batman, a normal life and a successor. Something to think about.