It looks like this:
There are only 4 visible targets and 4 more, i assume behind borders
Oh I see the issue, the viewport is smaller than the viewport I used, that's why I've never encountered this issue. And you're right if your screen is smaller than the maze, collectibles can spawn outside of the range of the window.
For simplicity, I didnt add any scrolling features to account for smaller screens, my apologies
Here is what the max-sized maze should look like