Why is my open level function crashing the engine?

Are you running this in a standalone player, or in editor? Because PIE does not necessarily play well with any sort of operations related to level loading/unloading.