### Summary

The ansible-core 2.15 ignores handlers notified by another handlers when are more than one  case.

With the ansible-core 2.14, all cases of handlers notified by another handlers are runned.

### Issue Type

Bug Report

### Component Name

notify

### Ansible Version

```console
ansible [core 2.15.0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.3 (main, Apr  5 2023, 15:52:25) [GCC 12.2.1 20230201] (/usr/bin/python)
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
CONFIG_FILE() = /etc/ansible/ansible.cfg
EDITOR(env: EDITOR) = vim
PAGER(env: PAGER) = less
```


### OS / Environment

Archlinux

ansible 7.6.0-1
ansible-core 2.15.0-1
ansible-lint 6.15.0.r45.g2fca3fe-2
python-ansible-compat 4.0.2-1

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
---
- name: Testing
  hosts: localhost
  tasks:
    - name: Trigger handlers
      debug:
        msg: Task 1
      changed_when: true
      notify: Handler 1
  handlers:
    - name: Handler 1
      debug:
        msg: Handler 1
      changed_when: true
      notify: Handler 2
    - name: Handler 2
      debug:
        msg: Handler 2
      changed_when: true
      notify: Handler 3
    - name: Handler 3
      debug:
        msg: Handler 3
```


### Expected Results

All handlers must be notified.

```console
PLAY [Testing] ********************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************
ok: [localhost]

TASK [Trigger handlers] ********************************************************************************************************
changed: [localhost] => {
    "msg": "Task 1"
}

RUNNING HANDLER [Handler 1] ********************************************************************************************************
changed: [localhost] => {
    "msg": "Handler 1"
}

RUNNING HANDLER [Handler 2] ********************************************************************************************************
changed: [localhost] => {
    "msg": "Handler 2"
}

RUNNING HANDLER [Handler 3] ********************************************************************************************************
changed: [localhost] => {
    "msg": "Handler 3"
}

PLAY RECAP ********************************************************************************************************
localhost                  : ok=5    changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
```

### Actual Results

Only the two first handlers were notified.

```console
PLAY [Testing] *************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************
ok: [localhost]

TASK [Trigger handlers] *************************************************************************************************
changed: [localhost] => {
    "msg": "Task 1"
}

RUNNING HANDLER [Handler 1] *************************************************************************************************
changed: [localhost] => {
    "msg": "Handler 1"
}

RUNNING HANDLER [Handler 2] *************************************************************************************************
changed: [localhost] => {
    "msg": "Handler 2"
}

PLAY RECAP *************************************************************************************************
localhost                  : ok=4    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
self._hosts_cache = []
        self._hosts_cache_all = []
        self.debugger_active = C.ENABLE_TASK_DEBUGGER
    def _set_hosts_cache(self, play, refresh=True):
        """Responsible for setting _hosts_cache and _hosts_cache_all
        See comment in ``__init__`` for the purpose of these caches
        """
        if not refresh and all((self._hosts_cache, self._hosts_cache_all)):
            return
        if not play.finalized and Templar(None).is_template(play.hosts):
            _pattern = 'all'
        else:
            _pattern = play.hosts or 'all'
        self._hosts_cache_all = [h.name for h in self._inventory.get_hosts(pattern=_pattern, ignore_restrictions=True)]
        self._hosts_cache = [h.name for h in self._inventory.get_hosts(play.hosts, order=play.order)]
    def cleanup(self):
        
        for sock in self._active_connections.values():
            try:
                conn = Connection(sock)
                conn.reset()
            except ConnectionError as e:
                
                display.debug("got an error while closing persistent connection: %s" % e)
        self._final_q.put(_sentinel)
        self._results_thread.join()
    def run(self, iterator, play_context, result=0):