The logic for prev/rand/next URL is done entirely in the molniya.py lib. Everything is handled by the molniya lib, with the CGI pages just acting as a front-end to that.
So I wrote next.cgi, copied it over to prev and rand.cgi...
And forgot to change the method call.
Prev and rand links should now work as intended. My bad!