How does the second hydrolysis of phthalimide work (hydrolysis of amide)?

In the hydrolysis of Phthalimides we can see two successive hydrolysis of "amides" [see ChemLibre for a nice mechanism](https://chem.libretexts.org/Bookshelves/Organic_Chemistry/Supplemental_Modules_(Organic_Chemistry)/Amines/Synthesis_of_Amines/Gabriel_Synthesis)


This is interesting because normally (also according to [ChemLibre](https://chem.libretexts.org/Bookshelves/Organic_Chemistry/Organic_Chemistry_(McMurry)/21%3A_Carboxylic_Acid_Derivatives-_Nucleophilic_Acyl_Substitution_Reactions/21.02%3A_Nucleophilic_Acyl_Substitution_Reactions)) amides are very stable (the amine is a poor leaving group) and don't react.


Nevertheless the first hydrolysis can be rationalized because the nitrogen electrons are delocalized and there is ring strain. Similar to how beta-lactams are more reactive than normal amides.


However, the second reaction appears to be just a normal amide hydrolysis. How does this happen?


