I believe the problem is that pexpect treats all matches as regex. You have specified ‘#?’ which means the # is optional, effectively making the regex an empty string.
An empty string matches anything, so pexpect will send the response for ‘#?’ for everything.
I ran across a problem with expect response the same value to all prompt.
I have a task that execute a command and expecting four prompt the expect module response to the first prompt correctly but response to the 2nd & 3rd prompt with the same value from the 1st prompt.
All of your “questions” are the same. Because you are defining a hash/dict for responses, by providing the same key you are over writing the values.
If you need to respond multiple times to a question with different answers, this is not currently possible with the released version of the expect module but will be included in the next release.