TypeError: Expected sequence or array-like, got <class 'int'>

### Describe the bug

I built **sklearn v1.1dev0** from source following this **[here](https://scikit-learn.org/stable/developers/advanced_installation.html)** 

I am not sure it's a bug or not, but I get this:

```
Traceback (most recent call last):
  File "/home/utilisateur/kabartay/cloned/sport/football-bets/main/scikit-learn/sklearn/model_selection/_validation.py", line 687, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/home/scikit-learn/sklearn/pipeline.py", line 382, in fit
    self._final_estimator.fit(Xt, y, **fit_params_last_step)
  File "/home/scikit-learn/sklearn/calibration.py", line 283, in fit
    check_consistent_length(y, sample_aligned_params)
  File "/home/scikit-learn/sklearn/utils/validation.py", line 378, in check_consistent_length
    lengths = [_num_samples(X) for X in arrays if X is not None]
  File "/home/scikit-learn/sklearn/utils/validation.py", line 378, in <listcomp>
    lengths = [_num_samples(X) for X in arrays if X is not None]
  File "/home/scikit-learn/sklearn/utils/validation.py", line 317, in _num_samples
    raise TypeError(message)
TypeError: Expected sequence or array-like, got <class 'int'>
```

caused by 

```
File "/home/main/train_pipe_dev.py", line 301, in train_model
    model.fit(x_train, y_train, **fit_params)
  File "/home/scikit-learn/sklearn/model_selection/_search.py", line 875, in fit
    self._run_search(evaluate_candidates)
  File "/home/scikit-learn/sklearn/model_selection/_search.py", line 1375, in _run_search
    evaluate_candidates(ParameterGrid(self.param_grid))
  File "/home/scikit-learn/sklearn/model_selection/_search.py", line 852, in evaluate_candidates
    _warn_or_raise_about_fit_failures(out, self.error_score)
  File "/home/scikit-learn/sklearn/model_selection/_validation.py", line 368, in _warn_or_raise_about_fit_failures
    raise ValueError(all_fits_failed_message)
ValueError: 
```

I tried to git clone the source and build it step by step and getting that some tests for **v1.1.dev0** fails with TypeError:
Please check my investigation [here](https://github.com/scikit-learn/scikit-learn/pull/18170#issuecomment-1065171823) at pull [#18170](https://github.com/scikit-learn/scikit-learn/pull/18170)
Might that related? Any idea?


### Steps/Code to Reproduce

(code to be very big)
some eaxample what I wanted to do  is [here](https://github.com/scikit-learn/scikit-learn/pull/18170#issuecomment-1064410023)

What I am trying is to use Pipeline with CalibratedClassifierCV with ANN as base estimator and running GridSearchCV with it. 
Pipeline passes fit_params well, but I needed fit_params in CalibratedClassifierCV (which is under dev and be released in v1.1 stable, check [#18170](https://github.com/scikit-learn/scikit-learn/pull/18170) ) to pass for ANN estimator that requires some epochs, patience, batch size parameters control. 

### Expected Results

I expect smotth run of model.fit(X,y, **fit_params) where X is data DataFrame and y is target list/array.
No issue for stable sklearn versions, thus expected issue comes from dev version.

### Actual Results

Check above

### Versions

```shell
Python 3.8.12 | packaged by conda-forge | (default, Jan 30 2022, 23:53:36) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sklearn; sklearn.show_versions()

System:
    python: 3.8.12 | packaged by conda-forge | (default, Jan 30 2022, 23:53:36)  [GCC 9.4.0]
executable: /home/user/anaconda3/envs/sklearn-env/bin/python3
   machine: Linux-5.13.0-28-generic-x86_64-with-glibc2.10

Python dependencies:
      sklearn: 1.1.dev0
          pip: 21.0
   setuptools: 49.2.0
        numpy: 1.21.0
        scipy: 1.4.1
       Cython: 0.29.28
       pandas: 1.1.5
   matplotlib: 3.3.4
       joblib: 1.0.1
threadpoolctl: 2.1.0

Built with OpenMP: True

threadpoolctl info:
       filepath: /home/user/anaconda3/envs/sklearn-env/lib/libgomp.so.1.0.0
         prefix: libgomp
       user_api: openmp
   internal_api: openmp
        version: None
    num_threads: 12

       filepath: /home/user/.local/lib/python3.8/site-packages/numpy.libs/libopenblasp-r0-5bebc122.3.13.dev.so
         prefix: libopenblas
       user_api: blas
   internal_api: openblas
        version: 0.3.13.dev
    num_threads: 12
threading_layer: pthreads

       filepath: /home/user/.local/lib/python3.8/site-packages/scipy.libs/libopenblasp-r0-085ca80a.3.9.so
         prefix: libopenblas
       user_api: blas
   internal_api: openblas
        version: 0.3.9
    num_threads: 12
threading_layer: pthreads
```

COMMENT:
> What can be the issue with check_consistent_length function in sklearn/utils/validation.py?

It checks that you have the same number of samples, i.e. the size of the axis=0 is identical.
Here it means, that one array has 1000 elements and the second a single 1.

Labels: Bug, Needs Reproducible Code