Those entities which has no own global entity pointer assigned, are not required to be removed by ent_remove/ptr_remove, they are cleared by level_load().
If a global entity pointer is assigned, you should remove it, and set to NULL, like this:
ENTITY* created_entity;
...somewhere after level load:
created_entity = ent_create("filename.mdl",nullvector,NULL);
...on closing the level, and before new level load:
ptr_remove(created_entity);
created_entity = NULL;
this way when you load the level again, you can create it again safely.
the same is valid for created panels.