The build up of Carbon Monoxide triggers the feeling of suffocation, since air is 70% Nitrogen the body doesn’t recognize it as foreign, so you simply fall asleep.
Inhalation of carbon monoxide may cause nausea and headaches, but otherwise causes no distress to its victims, which is why it’s so insidious.
In capital punishment, the penalty is death, not death by torture, so even if painless it doesn’t negate the punishment in any way.