make GetSpawnOccupants more robust against invalid list queries

fixes #5588