diff --git a/bids/layout/layout.py b/bids/layout/layout.py
index c7624631..0e4874b7 100644
--- a/bids/layout/layout.py
+++ b/bids/layout/layout.py
@@ -397,6 +397,18 @@ class BIDSLayout(Layout):
             else:
                 md_kwargs[k] = v
 
+        # Provide some suggestions if target is specified and invalid.
+        if target is not None and target not in all_ents:
+            import difflib
+            potential = list(all_ents.keys())
+            suggestions = difflib.get_close_matches(target, potential)
+            if suggestions:
+                message = "Did you mean one of: {}?".format(suggestions)
+            else:
+                message = "Valid targets are: {}".format(potential)
+            raise ValueError(("Unknown target '{}'. " + message)
+                             .format(target))
+
         all_results = []
 
         # Get entity-based search results using the superclass's get()

Warn or error on misspecified (or changed due to pybids changes) target value
Going through the tutorial I saw that 
```python
# See all modality labels in this dataset
layout.get(return_type='id', target='modality')
```
is no longer producing any output (well - returns an empty list) although before was reporting `['anat', 'fmap', 'func']`.  Even though I know now -- CHANGELOG helps, it is `datatype` which is actually nothing -- I think it is an overall usability aspect. If I am asking to return some specific target, I can assume that there must be one defined/known, and then if nothing is actually returned, I would have appreciated to list what are the available "targets" here.  So, by default, I would have even appreciated an exception like `TargetNotFound` which ideally would have a list of available targets in its message or str; and may be optionally have a mode to just skip unknown targets. Not sure if that is something to be done on pybids or grabbit level, and not sure if I am missing some "flexibility" issue here that targets could be some arbitrary thing?
diff --git a/bids/layout/tests/test_layout.py b/bids/layout/tests/test_layout.py
index f6ccc122..57733f52 100644
--- a/bids/layout/tests/test_layout.py
+++ b/bids/layout/tests/test_layout.py
@@ -135,6 +135,17 @@ def test_get_metadata_via_bidsfile(layout_7t_trt):
     assert 'subject' not in result
 
 
+def test_get_with_bad_target(layout_7t_trt):
+    with pytest.raises(ValueError) as exc:
+        layout_7t_trt.get(target='unicorn')
+        msg = exc.value.message
+        assert 'subject' in msg and 'reconstruction' in msg and 'proc' in msg
+    with pytest.raises(ValueError) as exc:
+        layout_7t_trt.get(target='sub')
+        msg = exc.value.message
+        assert 'subject' in msg and 'reconstruction' not in msg
+
+
 def test_get_bvals_bvecs(layout_ds005):
     dwifile = layout_ds005.get(subject="01", datatype="dwi")[0]
     result = layout_ds005.get_bval(dwifile.path)

pip install -e .[analysis]
parse_log_pytest
requirements.txt
pytest pytest-xdist
apt-get update apt-get install -y gcc
3.9
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
docopt==0.6.2
exceptiongroup==1.2.2
execnet==2.1.1
grabbit==0.2.5
importlib_resources==6.5.2
iniconfig==2.1.0
nibabel==5.3.2
num2words==0.5.14
numpy==2.0.2
packaging==24.2
pandas==2.2.3
patsy==1.0.1
pluggy==1.5.0
-e git+https://github.com/bids-standard/pybids.git@36853b0bf222d3174ae7d9d1d9c7a7ecf5049cdd#egg=pybids
pytest==8.3.5
pytest-xdist==3.6.1
python-dateutil==2.9.0.post0
pytz==2025.2
scipy==1.13.1
six==1.17.0
tomli==2.2.1
typing_extensions==4.13.0
tzdata==2025.2
zipp==3.21.0

name: pybids
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - docopt==0.6.2
      - exceptiongroup==1.2.2
      - execnet==2.1.1
      - grabbit==0.2.5
      - importlib-resources==6.5.2
      - iniconfig==2.1.0
      - nibabel==5.3.2
      - num2words==0.5.14
      - numpy==2.0.2
      - packaging==24.2
      - pandas==2.2.3
      - patsy==1.0.1
      - pluggy==1.5.0
      - pytest==8.3.5
      - pytest-xdist==3.6.1
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - scipy==1.13.1
      - six==1.17.0
      - tomli==2.2.1
      - typing-extensions==4.13.0
      - tzdata==2025.2
      - zipp==3.21.0
prefix: /opt/conda/envs/pybids

bids/layout/tests/test_layout.py::test_get_with_bad_target
bids/layout/tests/test_layout.py::test_layout_init bids/layout/tests/test_layout.py::test_layout_repr bids/layout/tests/test_layout.py::test_load_description bids/layout/tests/test_layout.py::test_get_metadata bids/layout/tests/test_layout.py::test_get_metadata2 bids/layout/tests/test_layout.py::test_get_metadata3 bids/layout/tests/test_layout.py::test_get_metadata4 bids/layout/tests/test_layout.py::test_get_metadata_meg bids/layout/tests/test_layout.py::test_get_metadata5 bids/layout/tests/test_layout.py::test_get_metadata_via_bidsfile bids/layout/tests/test_layout.py::test_get_bvals_bvecs bids/layout/tests/test_layout.py::test_get_subjects bids/layout/tests/test_layout.py::test_get_fieldmap bids/layout/tests/test_layout.py::test_get_fieldmap2 bids/layout/tests/test_layout.py::test_bids_json bids/layout/tests/test_layout.py::test_include bids/layout/tests/test_layout.py::test_layout_with_derivs bids/layout/tests/test_layout.py::test_layout_with_multi_derivs bids/layout/tests/test_layout.py::test_query_derivatives bids/layout/tests/test_layout.py::test_get_bidsfile_image_prop bids/layout/tests/test_layout.py::test_restricted_words_in_path bids/layout/tests/test_layout.py::test_derivative_getters
bids/layout/layout.py
bids/layout/layout.py