Level_load removes all ents then loads the new level

If physX_open is called first then you should not need ph--destroy
Like I said I used your main() with my levels and could not repeat the error.

physX_open()
level_load(...)

if(!key && lock ==1)
lock =0;
if(key && lock==0)
{
lock=1;
level_load(..)
}
press key 20 times, no issue... You'r problem seems elsewhere.