With an N-trityl substituent, the carbene attacks a nearby trityl phenyl ring. Addition across an arene bond gives a norcaradiene-like cyclopropane, followed by electrocyclic opening to the seven-membered cycloheptatriene: this is a Buchner ring expansion. Intramolecular trapping explains the fused product rather than an intermolecular carbene reaction.
With N-tert-butyl, there is no pendant arene. Instead the carbene inserts into a C-H bond of one tert-butyl methyl group. The new bond between the carbene carbon and that methyl carbon closes the five-membered N-containing ring; H is transferred to the carbene carbon in the same insertion. The remaining two methyl groups stay on the carbon attached to N.