<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
<!--- Explain the problem briefly below -->
While using a simple reproducer with either force_valid_group_names=silently or force_valid_group_names=always an unexpected exception is thrown:
Sample playbook:

```
---
- hosts: localhost
  connection: local
  gather_facts: false
  tasks: 
    - name: add a host to a group
      add_host:
        name: localhost
        groups: Not-Working
```

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
inventory
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```
ansible --version
ansible 2.9.0.dev0
  config file = /opt/gmuniz/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/ansible-devel/ansible/lib/ansible
  executable location = /opt/ansible-devel/ansible/bin/ansible
  python version = 2.7.5 (default, Apr  9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```
ansible-config dump --only-changed
TRANSFORM_INVALID_GROUP_CHARS(/opt/gmuniz/ansible.cfg) = always

```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
CentOs-7

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->

<!--- Paste example playbooks or commands between quotes below -->
```
- hosts: localhost
  connection: local
  gather_facts: false
  tasks: 
    - name: add a host to a group
      add_host:
        name: localhost
        groups: Not-Working

```

<!--- HINT: You can paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->
I expect the host to be added to the group either with the originally provided name or the replaced underscore name.

##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes -->
```
TASK [add a host to a group] *************************************************************************************************************************************************************************************
task path: /opt/gmuniz/add_host.yml:6
creating host via 'add_host': hostname=localhost
 [WARNING]: A duplicate localhost-like entry was found (localhost). First found localhost was localhost

 [WARNING]: Invalid characters were found in group names and automatically replaced, use -vvvv to see details

ERROR! Unexpected Exception, this is probably a bug: u'Not-Working'

```

prompt_continuous = '> '  
    def __init__(self, task, host, task_vars, play_context, result, next_action):
        
        cmd.Cmd.__init__(self)
        self.prompt = '[%s] %s (debug)> ' % (host, task)
        self.intro = None
        self.scope = {}
        self.scope['task'] = task
        self.scope['task_vars'] = task_vars
        self.scope['host'] = host
        self.scope['play_context'] = play_context
        self.scope['result'] = result
        self.next_action = next_action
    def cmdloop(self):
        try:
            cmd.Cmd.cmdloop(self)
        except KeyboardInterrupt:
            pass
    do_h = cmd.Cmd.do_help
    def do_EOF(self, args):
        """Quit"""
        return self.do_quit(args)
    def do_quit(self, args):
        """Quit"""
        display.display('User interrupted execution')
        self.next_action.result = NextAction.EXIT
        return True
    do_q = do_quit
    def do_continue(self, args):