There's a whole lot of loglines at debug=4. I grabbed the block of lines that seem to belong to the failing INVITE.
2(5209) DEBUG: <core> [msg_translator.c:206]: check_via_address(): check_via_address(10.0.0.1, 10.0.0.1, 0)
2(5209) DEBUG: siputils [checks.c:103]: has_totag(): no totag
2(5209) DEBUG: tm [t_lookup.c:1100]: t_check_msg(): DEBUG: t_check_msg: msg id=9 global id=7 T start=(nil)
2(5209) DEBUG: tm [t_lookup.c:534]: t_lookup_request(): t_lookup_request: start searching: hash=307, isACK=0
2(5209) DEBUG: tm [t_lookup.c:492]: matching_3261(): DEBUG: RFC3261 transaction matching failed
2(5209) DEBUG: tm [t_lookup.c:716]: t_lookup_request(): DEBUG: t_lookup_request: no transaction found
2(5209) DEBUG: tm [t_lookup.c:1169]: t_check_msg(): DEBUG: t_check_msg: msg id=9 global id=9 T end=(nil)
2(5209) INFO: <script>: LOCATION
2(5209) INFO: <script>: RELAY
2(5209) DEBUG: tm [t_lookup.c:1400]: t_newtran(): DEBUG: t_newtran: msg id=9 , global msg id=9 , T on entrance=(nil)
2(5209) DEBUG: tm [t_lookup.c:534]: t_lookup_request(): t_lookup_request: start searching: hash=307, isACK=0
2(5209) DEBUG: tm [t_lookup.c:492]: matching_3261(): DEBUG: RFC3261 transaction matching failed
2(5209) DEBUG: tm [t_lookup.c:716]: t_lookup_request(): DEBUG: t_lookup_request: no transaction found
2(5209) DEBUG: tm [t_hooks.c:374]: run_reqin_callbacks_internal(): DBG: trans=0x7f3c9ac29d90, callback type 1, id 0 entered
2(5209) DEBUG: dialog [dlg_handlers.c:724]: dlg_onreq(): dialog creation on config flag
2(5209) DEBUG: dialog [dlg_hash.c:664]: internal_get_dlg(): no dialog callid='a84d5218-a202-1231-5d9f-52540051a1d1' found
2(5209) DEBUG: dialog [dlg_hash.c:695]: get_dlg(): no dialog callid='a84d5218-a202-1231-5d9f-52540051a1d1' found
2(5209) DEBUG: dialog [dlg_hash.c:439]: build_new_dlg(): new dialog on hash 3304
2(5209) DEBUG: dialog [dlg_handlers.c:274]: populate_leg_info(): route_set , contact sip:john.doe.3@2.mail.example.com:5080;transport=udp;gw=testpbxs1, cseq 49802847 and bind_addr udp:
10.0.0.2:5060
2(5209) DEBUG: dialog [dlg_hash.c:718]: link_dlg(): linking dialog [3304:2157]
2(5209) DEBUG: dialog [dlg_hash.c:727]: link_dlg(): ref dlg 0x7f3c9ac2b0c0 with 1 -> 1
2(5209) DEBUG: dialog [dlg_hash.c:747]: dlg_ref(): ref dlg 0x7f3c9ac2b0c0 with 1 -> 2
2(5209) DEBUG: dialog [dlg_profile.c:406]: set_current_dialog(): setting current dialog [3304:2157]
2(5209) DEBUG: dialog [dlg_hash.c:765]: dlg_unref(): unref dlg 0x7f3c9ac2b0c0 with 1 -> 1
2(5209) DEBUG: dialog [dlg_hash.c:600]: dlg_lookup(): ref dlg 0x7f3c9ac2b0c0 with 1 -> 2
2(5209) DEBUG: dialog [dlg_hash.c:602]: dlg_lookup(): dialog id=2157 found on entry 3304
2(5209) DEBUG: dialog [dlg_handlers.c:729]: dlg_onreq(): dialog added to tm callbacks
2(5209) DEBUG: dialog [dlg_hash.c:765]: dlg_unref(): unref dlg 0x7f3c9ac2b0c0 with 1 -> 1
2(5209) DEBUG: tm [t_hooks.c:374]: run_reqin_callbacks_internal(): DBG: trans=0x7f3c9ac29d90, callback type 1, id 0 entered
2(5209) DEBUG: tm [t_funcs.c:347]: t_relay_to(): SER: new INVITE
2(5209) DEBUG: <core> [msg_translator.c:206]: check_via_address(): check_via_address(10.0.0.1, 10.0.0.1, 0)
2(5209) DEBUG: <core> [mem/shm_mem.c:111]: _shm_resize(): WARNING:vqm_resize: resize(0) called
2(5209) DEBUG: tm [t_reply.c:706]: _reply_light(): DEBUG: reply sent out. buf=0x7f3ca36c25a0: SIP/2.0 100 trying -..., shmem=0x7f3c9ac2c7f0: SIP/2.0 100 trying -
2(5209) DEBUG: tm [t_reply.c:716]: _reply_light(): DEBUG: _reply_light: finished
2(5209) DEBUG: <script>: new branch [0] to sip:93m51afg@nj1hjakcqv9a.invalid;transport=ws
2(5209) WARNING: <core> [msg_translator.c:2499]: via_builder(): TCP/TLS connection (id: 0) for WebSocket could not be found
2(5209) ERROR: <core> [msg_translator.c:1725]: build_req_buf_from_sip_req(): could not create Via header
2(5209) ERROR: tm [t_fwd.c:435]: prepare_new_uac(): could not build request
2(5209) ERROR: tm [t_fwd.c:1534]: t_forward_nonack(): ERROR: t_forward_nonack: failure to add branches
2(5209) DEBUG: tm [t_funcs.c:357]: t_relay_to(): ERROR:tm:t_relay_to: t_forward_nonack returned error
2(5209) DEBUG: tm [t_funcs.c:365]: t_relay_to(): -2 error reply generation delayed
2(5209) DEBUG: <core> [msg_translator.c:206]: check_via_address(): check_via_address(10.0.0.1, 10.0.0.1, 0)
2(5209) ERROR: sl [sl_funcs.c:371]: sl_reply_error(): ERROR: sl_reply_error used: No error (2/SL)
2(5209) DEBUG: dialog [dlg_hash.c:600]: dlg_lookup(): ref dlg 0x7f3c9ac2b0c0 with 1 -> 2
2(5209) DEBUG: dialog [dlg_hash.c:602]: dlg_lookup(): dialog id=2157 found on entry 3304
2(5209) DEBUG: dialog [dlg_hash.c:765]: dlg_unref(): unref dlg 0x7f3c9ac2b0c0 with 1 -> 1
2(5209) DEBUG: tm [t_lookup.c:1553]: t_unref(): t_unref: delayed error reply generation(-2)
2(5209) DEBUG: <core> [msg_translator.c:206]: check_via_address(): check_via_address(10.0.0.1, 10.0.0.1, 0)
2(5209) DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f3c9ac29d90, callback type 1048576, id 0 entered