It's clear that when you use a local panel pointer, and something happens to that panel while the function is still running, it will crash. Such a crash happens randomly, since you're accessing memory with random content. Storing the pointer in a skill is placebo coding, technically it makes no difference.

Such a crash is caused of course by removing the panel, but also by more innocent operations such as removing a bitmap, removing a different panel that shares a bitmap, or saving and loading the game.

If I would design the acknex engine today, I would implement a different allocation and release mechanism. But as it is, ptr_remove just releases the memory of the panel and all its bitmaps. There is no simple way to check if an object pointer is valid or not. The only way is to go through the list of all objects with ptr_first(), and check if the pointer is still in the list.