That is on purpose. It's meant to be mostly luck, especially since you are navigating a maze in the dark. The method to find the endings is to approach it strategically (cover all the space, even if it takes multiple playthroughs). Or be really lucky, lol.
Thank you for playing!