You have to exit the level before the hour ends, this gives you a limited number of moves in each stage. watch the time top left (it starts flickering yellow/red when it gets dangerous). To leave the level you must either defeat all monsters or open all treasures. Then the door opens. It’s up to you how much risk you take, exploring all to find another anvil or barrel or not.
also watch the tooltips of the monsters closely, some strike first and might therefore kill you. you have to find a way around them or get strong enough to defeat them. and all that, before time runs out. ;-)
regarding the bug: i got this reported already but was not able to fix it in time, sorry. you might have to reload after dying through time.