This issue mainly occurs on gateways products including TA, TB, TE, TG series. And the call source of the route is Register Type SIP trunk or Account Type SIP trunk . The Peer Type (Service Provider) would not have this kind of issue.
When you debug in the Asterisk CLI, you could see the similar log:
chan_sip.c:22494 handle_request_invite: Call from 'XXXX' to extension 'YY' rejected because extension not found.
It's hidden drawback of the dialplan.
Use Non-Simple mode for the IP to Port route. And fill a dot in the DID Number field.