if I ask for a list of open document names in SD and SD is visible, the list returns the documents in stack order. The same script returns documents in open order if SD is hidden.
The consequence is that if I ask for document 1 while SD is hidden, I get the first opened document instead of the frontmost document.
Here are some screenshots to illustrate the issue (the files were opened in alphabetical order and then re-arranged in random order):
Script Debugger open documents:

List of documents with SD open:

List of documents with SD hidden:

The SD Window menu

I get the same issue with set theDoc to current document of script window 1
Does anyone have a solution for this?
macOS Sequoia 15.7.7 (24G720) French localization
FastScripts 3.3.8 (1967)
Script Debugger 8.0.11 (8A90)
Mac Studio M4 Max