Sometimes last function is triggered twice

Sometimes the maze_end_generation.mcfunction seems to trigger twice. When looking myself I feel like something is going wrong while it's trying to execute the maze_backtrack.mcfunction, since it does not always give the testing response of Back East and it just seems to do multiple maze_backtrack.mcfunction.

Can someone help me spot what the issue is here?

The order of operations should be:

  1. maze_start.mcfunction
  2. maze_step.mcfunction 3a) maze_forward.mcfunction (if there are unvisited nodes next to it) 3b) maze_backtrack.mcfunction (if there are NO unvisited nodes next to it)
  3. maze_end_generation (when it tries to backtrack and is at the start node)
Continue to help post