I think GP meant if there's an island in the middle, it won't work following that. But if you start from the entrance, it's fine.
It's a good algorithm within some very specific constraints.
The trick used in the github issue cited by the other reply is a similar idea, but the change in y axis value is applied to the exit rather than throughout the maze, via a tunnel from the center.