The backtrace seems to be from the core file generated on shutdown. Likely the core file generated for the runtime issue was overwritten.
Look in the logs and see if you can spot logs printed by PID `2858`, that is the process that crashed.
Also, enable core file per process/pid, see:
* https://www.kamailio.org/wiki/tutorials/troubleshooting/coredumpfile#how_do_...
Then try to reproduce and you should eventually get more than one core file. Paste here the gdb `bt full` for each of the core files.