Contain order does not match

Good night everybody …
Here is some code :

$this->paginate = [
            'contain' => [
                'Tags' => function($q) {
                    return $q->select(['', ''])->order(['' => 'asc']);
            'order' => ['' => 'asc'],
            'limit' => [50]

Tags are not sorted so what’s wrong ?

If you look at the generated query, is it right? If you add something like a ->limit(1), does that have an effect? (Not suggesting that as a “fix”, but as a way to tell whether it’s the order part that’s failing, or something deeper.)

Thank you for replying.

Sorry, this list does not come from this method.
It comes from an ajax call so that I have two lists ordered differently.

Sorry for wasting your time and thank you again.
Often, when facing a problem, you end up not seing the right place.