After some deliberation, we have decided that on_remove hooks will no longer support structural changes in its scope. This comes with the rationale that it required very expensive pessimization to detect and to resolve it. It is possible that in the future we allow those structural changes if the on_remove hooks are invoked by world:remove calls and not world:delete. The workaround on this is simply to defer outside the lexical scope by pushing into a queue that gets flushed or inside of a deferred coroutine at the start of the next sync point.
Currently it will hard error regardless of debug mode when there are detected structural changes in on_remove hooks that gets invoked by replacements of exclusive ids or via world:remove calls
Fixed world:entity returning nil