If your party suffers defeat, all of the heroes in that party will come down with a bad case of Maze Sickness.
While they will no longer be usable in the current maze, you can form another party with healthy heroes in order to continue your journey.

Still, it's best to choose your heroes with care to avoid being defeated! Some enemies in the maze possess special abilities which make them completely immune to damage from certain types of heroes. It's a good idea to check out these enemies' traits before entering the Dark Maze. You can view them and what they do before entering a level by tapping the trait icons. It might also help to keep an eye on the elements you face in the dungeons to find out whether the monsters there are immune.