Hi Vincent,

> I encountered this specific error using BaseX GUI by running this script while a database was open. 

I see: Mixing the GUI and other independent BaseX instances may indeed unexpected errors.

> If db:list() is not working, is there any way to identify which databases might be corrupt, locked, or somehow causing a problem?

In principle, db:list() (without arguments) is nothing else than a file:list() operation for the database directory. You should be able to simulate it with:

  for $db in file:children(db:option('dbpath'))
  where file:is-dir($db)
  return file:name($db)

Do you remember what happened when you tried to use db:list?

Best,
Christian