What can be probable causes for crashing rack on deletion of a module?
No need to guess. Use a debugger.
I like to guess…
you have a global object, created one time (in singleton way) that is destroyed on exit of your first deleted module and your crash is happening on deleting your second module (a duplicate delete as @stoermelder is saying)
I’ll have to digest that a bit. Thanks @synthi