According to your clarifying comment, backspace in your terminal is neither curses.KEY_BACKSPACE (int(263)'KEY_BACKSPACE' on mine, but it works) nor \b'\b' (\x08'\x08').
Since you're using curses.wrapper(), which calls curses.initscr(), this suggests that something is wrong with either your terminfo database (unlikely) or your terminal configuration (more likely).
getkey() == 'KEY_BACKSPACE' or getch() == curses.KEY_BACKSPACE is supposed to work on any properly-configured system, so you're likely to have problems in other applications too.
The TERM environment variable is how the terminal type is communicated to tools which need the functionality beyond basic teletype, so, to fix that, start by checking what the TERM environment variable contains in the environment where you're running Python.
print(os.environ['TERM'])
As a quick hack, you can check all the values it's been observed to take.
if key in ('KEY_BACKSPACE', '\b', '\x7f'):