Z-Wave Switch Worked and then didn't
Smart switches don't like being upside down and backwards

What happened with your smart switch is that you swapped the Line and Load terminals -- it would not surprise me if something is acting goofy, or if the switch is somehow damaged even, as a result of that.  Try connecting the red wire to the Line terminal on a new smart switch with a proper pigtail (instead of the current configuration) and the black wire to the Load terminal -- you wired up the neutral and ground fine, though.

If that doesn't do the trick, I'd make sure nothing is shorting when you stuff it into the backbox -- wrapping the device with electrical tape and ensuring screws are tight helps.