I have written a PHP script to select a certain number of images from a pool of many and display them in a random order but I have not been able to replicate the problem you describe.
The images displayed (and their order) change each time the gallery is displayed (just like your gallery) but the images retain their order when the gallery is expanded.
(I have also tried setting expandInNewPage to AUTO, TRUE and FALSE with the same results each time.)
From your own scenario, it certainly looks like Juicebox refers to the XML file (seeing a new set of images) when the gallery is expanded.
I think the problem may be due to web server cache settings.
If your browser has cached the XML file, then Juicebox should be able to refer to the cached version and display the same images in the expanded gallery as in the normal version.
However, if your web server does not allow browsers to cache files and forces browsers to fetch files from the server each time they are required, then Juicebox would have no option but to use a freshly-generated XML file with a new set of images when the gallery is expanded.
Please check your web server's Cache-Control headers. Allowing browsers to cache files may solve your problem.
Try adding the following code to an .htaccess file in your root directory (as long as you have an Apache web server).
<IfModule mod_headers.c>
Header set Cache-Control "max-age=86400"
</IfModule>
Alternatively, try setting the header via PHP (at the top of your 'config.php' file) with the following code:
header("Cache-Control: max-age=86400");
I hope this helps.