you need to load the level first, and then perform a wait.
like this:
set(running_pan,VISIBLE); //Loads the loading screen
level_load(levelname); //loads my level
wait(-5); //waits till the level loads
reset(running_pan,VISIBLE); //resets the loading screen.
Dont know if that solves the bug, but it should help you in the right direction.
regards,