I got a bit of time to look at it on an Ubuntu 20.04 and it seems a similar case to one that was solved a while ago:
* https://github.com/kamailio/kamailio/issues/2560#issuecomment-777590116
In short, kamailio has to be started with `--atexit=no` cli param.
I added a note in the readme of the tls module:
* https://github.com/kamailio/kamailio/commit/8dc18cab5bc32c1d34a9113242d230b7...
I tested with the minimal config from the description of this issues, it crashes without `--atexit=no` and with it goes till errors related to not finding the certificate/key files.