Repository: langchain
Issue: Neo4jVector.from_existing_index() doesn't error if given an invalid index_name
Labels: 🤖:bug

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.
- [X] I am sure that this is a bug in LangChain rather than my code.
- [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

### Example Code

The following code attempts to create a Neo4jVector from an existing index which doesn't exist (but other indexes do).

It fails silently returning a random index.
```python
try:
    self.neo4j_vector = Neo4jVector.from_existing_index(
        graph=self.neo4j_graph,
        embedding=embeddings,
        index_name="this-index-does-not-exist",
    )
except Exception as e:
    print(f"Neo4jVector.from_existing_index failed:{e}")
    raise e            

print(f"index returned: {self.neo4j_vector.index_name}")
```

yields output
```console
index returned: vector
```

(I have another index in the DB called 'vector')

No exception is raised nor is the return value from `from_existing_index()` equal to NULL.
### Error Message and Stack Trace (if applicable)

_No response_

### Description

The best place to resolve this seems to be in in `neo4j_vector.py:sort_by_index_name()`

Currently:
```python
def sort_by_index_name(
    lst: List[Dict[str, Any]], index_name: str
) -> List[Dict[str, Any]]:
    """Sort first element to match the index_name if exists"""
    return sorted(lst, key=lambda x: x.get("name") != index_name)
```

If we return an empty list in the case where `index_name` isn't there, the error handling logic in caller functions works as expected, and the issue can be detected at the user application level:
```python
def sort_by_index_name(
    lst: List[Dict[str, Any]], index_name: str
) -> List[Dict[str, Any]]:
    if not index_name in [el.get("name") for el in lst]:
        return []
    """Sort first element to match the index_name if exists"""
    return sorted(lst, key=lambda x: x.get("name") != index_name)
```

### System Info

System Information
------------------
> OS:  Linux
> OS Version:  #1 SMP Fri Mar 29 23:14:13 UTC 2024
> Python Version:  3.11.9 (main, Apr  6 2024, 17:59:24) [GCC 11.4.0]

Package Information
-------------------
> langchain_core: 0.3.15
> langchain: 0.3.7
> langchain_community: 0.3.5
> langsmith: 0.1.142
> langchain_openai: 0.2.0
> langchain_text_splitters: 0.3.0
> langchain_together: 0.2.0

Optional packages not installed
-------------------------------
> langgraph
> langserve

Other Dependencies
------------------
> aiohttp: 3.10.5
> async-timeout: Installed. No version info available.
> dataclasses-json: 0.6.7
> httpx: 0.27.2
> httpx-sse: 0.4.0
> jsonpatch: 1.33
> numpy: 1.26.4
> openai: 1.46.0
> orjson: 3.10.7
> packaging: 24.1
> pydantic: 2.8.2
> pydantic-settings: 2.5.2
> PyYAML: 6.0.2
> requests: 2.32.3
> requests-toolbelt: 1.0.0
> SQLAlchemy: 2.0.35
> tenacity: 8.5.0
> tiktoken: 0.7.0
> typing-extensions: 4.12.2