If your question is about the logic of making a random level, the answers are not Godot specific and you should look up "generating mazes". Many approaches are to make some random rooms and then connect them.
If you have a more Godot specific question, could you add many more details?