Have I found the culprit? Not sure.
But I think it's because sometimes pixels render on the direct edge of the picture, which seems to be a problem in GIMP 2.10.
I have done the following changes to avoid this behaviour and run the script several times and with lots of stars! without errors:
Find following lines in the sections and replace
Generating small stars
(set! xs (rand width))
(set! ys (rand height))
change to:
(set! xs (rand (- width 1)))
(set! ys (rand (- height 1)))
Generating medium stars
(set! xm (rand (- width 1)))
(set! ym (rand (- height 1)))
change to:
(set! xm (rand (- width 2)))
(set! ym (rand (- height 2)))
Generating big stars
(set! xb (rand (- width 2)))
(set! yb (rand (- height 2)))
change to:
(set! xb (rand (- width 3)))
(set! yb (rand (- height 3)))