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?
in which case the only “problem” with his question would be the category it is in. It might be in Gossip rather than Engine. This site allows any questions as long as its related to game development.