This might help to explain why generating a song of that length might take a while or even may not be possible: if you were to unfold a song that has 40 choruses with each chorus containing 255 measures, that'd be approximately 10,200 total bars you'd be asking Band-in-a-Box to play and generate and then render if exporting to an audio file. For best performance, the max number of measures you can have would be 255. You may start to experience issues after that with playback or generation, and potentially in other ways too.
That said, I tried to set it to 255 at 40 choruses just to test it, and it did change to 7 immediately after I tried picking 40. As Band-in-a-Box's max is 255, I'm not surprised that a song created at all these maxes may not work as it's basically being asked to generate over 10k bars. I will ask the developers about expected behaviours when pushing the program, but I don't suspect this is a bug so much as a program limitation, but I'll share what I find out!