If all you’re trying to do ‘special’ is bypass the carrier on calls to your own DIDs, see
After creating the loopback trunk, set an Outbound Route after your emergency routes but before your regular routes, which matches all your DIDs and routes to the loopback trunk.
This will show the caller’s external number as caller ID, while the Custom Extension scheme will show the caller’s extension number.