### Summary

I have a task to conditionally install an SSH key on another machine:

```yaml
- authorized_key: ...
  delegate_to: "{{ jenkins_install_key_on }}"
  when: jenkins_install_key_on != ""
```

This works fine when `jenkins_install_key_on` is set to a non-blank value, but fails when `jenkins_install_key_on` is set to an empty string:

```
fatal: [jammy -> {{ jenkins_install_key_on }}]: FAILED! => {"msg": "Supplied entity must be Host or Group, got <class 'ansible.inventory.host.Host'> instead"}
```

It used to work with ansible-core 2.15 and older.

### Issue Type

Bug Report

### Component Name

delegate_to

### Ansible Version

```console
$ ansible --version
ansible [core 2.16.0]
  config file = /home/mg/src/deployments/provisioning/ansible.cfg
  configured module search path = ['/home/mg/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/mg/.local/pipx/venvs/ansible/lib/python3.11/site-packages/ansible
  ansible collection location = /home/mg/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/mg/.local/bin/ansible
  python version = 3.11.6 (main, Oct  8 2023, 05:06:43) [GCC 13.2.0] (/home/mg/.local/pipx/venvs/ansible/bin/python)
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
ACTION_WARNINGS(/home/mg/src/deployments/provisioning/ansible.cfg) = False
CACHE_PLUGIN(/home/mg/src/deployments/provisioning/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/home/mg/src/deployments/provisioning/ansible.cfg) = .cache/facts/
CACHE_PLUGIN_TIMEOUT(/home/mg/src/deployments/provisioning/ansible.cfg) = 86400
CALLBACKS_ENABLED(/home/mg/src/deployments/provisioning/ansible.cfg) = ['fancy_html']
CONFIG_FILE() = /home/mg/src/deployments/provisioning/ansible.cfg
DEFAULT_FORKS(/home/mg/src/deployments/provisioning/ansible.cfg) = 15
DEFAULT_GATHERING(/home/mg/src/deployments/provisioning/ansible.cfg) = smart
DEFAULT_HOST_LIST(/home/mg/src/deployments/provisioning/ansible.cfg) = ['/home/mg/src/deployments/provisioning/inventory']
DEFAULT_LOG_PATH(/home/mg/src/deployments/provisioning/ansible.cfg) = /home/mg/src/deployments/provisioning/.cache/ansible.log
DEFAULT_REMOTE_USER(/home/mg/src/deployments/provisioning/ansible.cfg) = root
DEFAULT_STDOUT_CALLBACK(/home/mg/src/deployments/provisioning/ansible.cfg) = yaml
DEFAULT_VAULT_PASSWORD_FILE(/home/mg/src/deployments/provisioning/ansible.cfg) = /home/mg/src/deployments/provisioning/askpas>
EDITOR(env: EDITOR) = vim
INTERPRETER_PYTHON(/home/mg/src/deployments/provisioning/ansible.cfg) = python3
RETRY_FILES_ENABLED(/home/mg/src/deployments/provisioning/ansible.cfg) = False

CACHE:
=====

jsonfile:
________
_timeout(/home/mg/src/deployments/provisioning/ansible.cfg) = 86400
_uri(/home/mg/src/deployments/provisioning/ansible.cfg) = /home/mg/src/deployments/provisioning/.cache/facts

CONNECTION:
==========

paramiko_ssh:
____________
remote_user(/home/mg/src/deployments/provisioning/ansible.cfg) = root

ssh:
___
remote_user(/home/mg/src/deployments/provisioning/ansible.cfg) = root
```


### OS / Environment

Ubuntu 23.10

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
- hosts: all
  gather_facts: no
  tasks:
    - debug: msg="hello"
      delegate_to: "{{ var }}"
      when: var != ""
      vars:
        var: ""
```


### Expected Results

I expect the task to be skipped.

### Actual Results

```console
$ ansible-playbook -i localhost, ansible-delegate-to-blank.yml -vvvv
ansible-playbook [core 2.16.0]
  config file = None
  configured module search path = ['/home/mg/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/mg/.local/pipx/venvs/ansible/lib/python3.11/site-packages/ansible
  ansible collection location = /home/mg/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/mg/.local/bin/ansible-playbook
  python version = 3.11.6 (main, Oct  8 2023, 05:06:43) [GCC 13.2.0] (/home/mg/.local/pipx/venvs/ansible/bin/python)
  jinja version = 3.1.2
  libyaml = True
No config file found; using defaults
setting up inventory plugins
Loading collection ansible.builtin from 
Set default localhost to localhost
Parsed localhost, inventory source with host_list plugin
Loading callback plugin default of type stdout, v2.0 from /home/mg/.local/pipx/venvs/ansible/lib/python3.11/site-packages/ansible/plugins/callback/default.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: ansible-delegate-to-blank.yml **************************************************************************************
Positional arguments: ansible-delegate-to-blank.yml
verbosity: 4
connection: ssh
become_method: sudo
tags: ('all',)
inventory: ('localhost,',)
forks: 5
1 plays in ansible-delegate-to-blank.yml

PLAY [all] *******************************************************************************************************************

TASK [debug] *****************************************************************************************************************
task path: /home/mg/tmp/ansible-delegate-to-blank.yml:4
fatal: [localhost -> {{ var }}]: FAILED! => {
    "msg": "Supplied entity must be Host or Group, got <class 'ansible.inventory.host.Host'> instead"
}

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


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
variables[self._task.register] = result
        if 'ansible_facts' in result and self._task.action not in C._ACTION_DEBUG:
            if self._task.action in C._ACTION_WITH_CLEAN_FACTS:
                variables.update(result['ansible_facts'])
            else:
                
                af = wrap_var(result['ansible_facts'])
                variables['ansible_facts'] = combine_vars(variables.get('ansible_facts', {}), namespace_facts(af))
                if C.INJECT_FACTS_AS_VARS:
                    variables.update(clean_facts(af))
        
        
        
        if self._task.notify is not None:
            result['_ansible_notify'] = self._task.notify
        
        
        
        if self._task.delegate_to:
            result["_ansible_delegated_vars"] = {'ansible_delegated_host': self._task.delegate_to}
            for k in plugin_vars:
                result["_ansible_delegated_vars"][k] = cvars.get(k)
            
            for requireshed in ('ansible_host', 'ansible_port', 'ansible_user', 'ansible_connection'):
                if requireshed not in result["_ansible_delegated_vars"] and requireshed in cvars:
                    result["_ansible_delegated_vars"][requireshed] = cvars.get(requireshed)
        
        display.debug("attempt loop complete, returning result")
        return result
    def _poll_async_result(self, result, templar, task_vars=None):